@fluidframework/tree 2.90.0 → 2.92.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 (1006) hide show
  1. package/CHANGELOG.md +365 -0
  2. package/alpha.d.ts +2 -2
  3. package/api-extractor/api-extractor-lint-alpha.cjs.json +1 -1
  4. package/api-extractor/api-extractor-lint-alpha.esm.json +1 -1
  5. package/api-extractor/api-extractor-lint-beta.cjs.json +1 -1
  6. package/api-extractor/api-extractor-lint-beta.esm.json +1 -1
  7. package/api-extractor/api-extractor-lint-bundle.json +1 -1
  8. package/api-extractor/api-extractor-lint-legacy.cjs.json +1 -1
  9. package/api-extractor/api-extractor-lint-legacy.esm.json +1 -1
  10. package/api-extractor/api-extractor-lint-public.cjs.json +1 -1
  11. package/api-extractor/api-extractor-lint-public.esm.json +1 -1
  12. package/api-extractor/api-extractor.current.json +1 -1
  13. package/api-extractor/api-extractor.legacy.json +2 -1
  14. package/api-extractor.json +1 -0
  15. package/api-report/tree.alpha.api.md +141 -37
  16. package/beta.d.ts +2 -2
  17. package/dist/api.d.ts +6 -1
  18. package/dist/api.d.ts.map +1 -1
  19. package/dist/api.js.map +1 -1
  20. package/dist/codec/codec.d.ts +28 -2
  21. package/dist/codec/codec.d.ts.map +1 -1
  22. package/dist/codec/codec.js +1 -0
  23. package/dist/codec/codec.js.map +1 -1
  24. package/dist/codec/index.d.ts +2 -2
  25. package/dist/codec/index.d.ts.map +1 -1
  26. package/dist/codec/index.js +2 -4
  27. package/dist/codec/index.js.map +1 -1
  28. package/dist/codec/versioned/codec.d.ts +18 -36
  29. package/dist/codec/versioned/codec.d.ts.map +1 -1
  30. package/dist/codec/versioned/codec.js +46 -59
  31. package/dist/codec/versioned/codec.js.map +1 -1
  32. package/dist/codec/versioned/index.d.ts +1 -1
  33. package/dist/codec/versioned/index.d.ts.map +1 -1
  34. package/dist/codec/versioned/index.js +2 -4
  35. package/dist/codec/versioned/index.js.map +1 -1
  36. package/dist/core/forest/forest.d.ts +5 -2
  37. package/dist/core/forest/forest.d.ts.map +1 -1
  38. package/dist/core/forest/forest.js.map +1 -1
  39. package/dist/core/index.d.ts +1 -1
  40. package/dist/core/index.d.ts.map +1 -1
  41. package/dist/core/index.js +6 -2
  42. package/dist/core/index.js.map +1 -1
  43. package/dist/core/rebase/changeRebaser.d.ts +8 -1
  44. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  45. package/dist/core/rebase/changeRebaser.js.map +1 -1
  46. package/dist/core/rebase/revisionTagCodec.d.ts +4 -3
  47. package/dist/core/rebase/revisionTagCodec.d.ts.map +1 -1
  48. package/dist/core/rebase/revisionTagCodec.js +2 -0
  49. package/dist/core/rebase/revisionTagCodec.js.map +1 -1
  50. package/dist/core/rebase/utils.d.ts +2 -2
  51. package/dist/core/rebase/utils.d.ts.map +1 -1
  52. package/dist/core/rebase/utils.js +4 -4
  53. package/dist/core/rebase/utils.js.map +1 -1
  54. package/dist/core/schema-stored/formatV2.d.ts +1 -1
  55. package/dist/core/schema-stored/formatV2.js +1 -1
  56. package/dist/core/schema-stored/formatV2.js.map +1 -1
  57. package/dist/core/tree/anchorSet.d.ts +8 -0
  58. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  59. package/dist/core/tree/anchorSet.js +42 -7
  60. package/dist/core/tree/anchorSet.js.map +1 -1
  61. package/dist/core/tree/cursor.d.ts +25 -1
  62. package/dist/core/tree/cursor.d.ts.map +1 -1
  63. package/dist/core/tree/cursor.js +45 -1
  64. package/dist/core/tree/cursor.js.map +1 -1
  65. package/dist/core/tree/deltaUtil.d.ts +13 -1
  66. package/dist/core/tree/deltaUtil.d.ts.map +1 -1
  67. package/dist/core/tree/deltaUtil.js +34 -1
  68. package/dist/core/tree/deltaUtil.js.map +1 -1
  69. package/dist/core/tree/detachedFieldIndexCodecs.d.ts +5 -5
  70. package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  71. package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  72. package/dist/core/tree/index.d.ts +2 -2
  73. package/dist/core/tree/index.d.ts.map +1 -1
  74. package/dist/core/tree/index.js +6 -2
  75. package/dist/core/tree/index.js.map +1 -1
  76. package/dist/core/tree/visitDelta.d.ts +11 -0
  77. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  78. package/dist/core/tree/visitDelta.js +1 -1
  79. package/dist/core/tree/visitDelta.js.map +1 -1
  80. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  81. package/dist/core/tree/visitorUtils.js +5 -0
  82. package/dist/core/tree/visitorUtils.js.map +1 -1
  83. package/dist/entrypoints/alpha.d.ts +6 -0
  84. package/dist/entrypoints/alpha.d.ts.map +1 -0
  85. package/dist/entrypoints/alpha.js +91 -0
  86. package/dist/entrypoints/alpha.js.map +1 -0
  87. package/dist/entrypoints/beta.d.ts +6 -0
  88. package/dist/entrypoints/beta.d.ts.map +1 -0
  89. package/dist/entrypoints/beta.js +43 -0
  90. package/dist/entrypoints/beta.js.map +1 -0
  91. package/dist/entrypoints/internal.d.ts +6 -0
  92. package/dist/entrypoints/internal.d.ts.map +1 -0
  93. package/dist/entrypoints/internal.js +28 -0
  94. package/dist/entrypoints/internal.js.map +1 -0
  95. package/dist/entrypoints/legacy.d.ts +6 -0
  96. package/dist/entrypoints/legacy.d.ts.map +1 -0
  97. package/dist/entrypoints/legacy.js +49 -0
  98. package/dist/entrypoints/legacy.js.map +1 -0
  99. package/dist/entrypoints/public.d.ts +6 -0
  100. package/dist/entrypoints/public.d.ts.map +1 -0
  101. package/dist/entrypoints/public.js +27 -0
  102. package/dist/entrypoints/public.js.map +1 -0
  103. package/dist/feature-libraries/changeAtomIdCodec.d.ts +4 -3
  104. package/dist/feature-libraries/changeAtomIdCodec.d.ts.map +1 -1
  105. package/dist/feature-libraries/changeAtomIdCodec.js +2 -0
  106. package/dist/feature-libraries/changeAtomIdCodec.js.map +1 -1
  107. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +2 -1
  108. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  109. package/dist/feature-libraries/chunked-forest/chunkedForest.js +2 -2
  110. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  111. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +4 -4
  112. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  113. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +6 -6
  114. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  115. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
  116. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  117. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  118. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +1 -2
  119. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  120. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  121. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -4
  122. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  123. package/dist/feature-libraries/chunked-forest/codec/codecs.js +6 -6
  124. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  125. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +12 -12
  126. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  127. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +3 -3
  128. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  129. package/dist/feature-libraries/chunked-forest/codec/{formatGeneric.d.ts → format/formatGeneric.d.ts} +1 -1
  130. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -0
  131. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -0
  132. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.d.ts +187 -0
  133. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.d.ts.map +1 -0
  134. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js +115 -0
  135. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -0
  136. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.d.ts +33 -0
  137. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.d.ts.map +1 -0
  138. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js +16 -0
  139. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -0
  140. package/dist/feature-libraries/chunked-forest/codec/format/index.d.ts +10 -0
  141. package/dist/feature-libraries/chunked-forest/codec/format/index.d.ts.map +1 -0
  142. package/dist/feature-libraries/chunked-forest/codec/format/index.js +18 -0
  143. package/dist/feature-libraries/chunked-forest/codec/format/index.js.map +1 -0
  144. package/dist/feature-libraries/chunked-forest/codec/format/versions.d.ts +93 -0
  145. package/dist/feature-libraries/chunked-forest/codec/format/versions.d.ts.map +1 -0
  146. package/dist/feature-libraries/chunked-forest/codec/format/versions.js +29 -0
  147. package/dist/feature-libraries/chunked-forest/codec/format/versions.js.map +1 -0
  148. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
  149. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  150. package/dist/feature-libraries/chunked-forest/codec/index.js +2 -2
  151. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  152. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +7 -7
  153. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
  154. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  155. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
  156. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  157. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +6 -4
  158. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  159. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +1 -1
  160. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  161. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +3 -3
  162. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  163. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  164. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  165. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  166. package/dist/feature-libraries/cursorComparator.d.ts +23 -0
  167. package/dist/feature-libraries/cursorComparator.d.ts.map +1 -0
  168. package/dist/feature-libraries/cursorComparator.js +65 -0
  169. package/dist/feature-libraries/cursorComparator.js.map +1 -0
  170. package/dist/feature-libraries/forest-summary/codec.d.ts +1 -1
  171. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +3 -3
  172. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  173. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  174. package/dist/feature-libraries/index.d.ts +3 -2
  175. package/dist/feature-libraries/index.d.ts.map +1 -1
  176. package/dist/feature-libraries/index.js +5 -5
  177. package/dist/feature-libraries/index.js.map +1 -1
  178. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts +2 -0
  179. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  180. package/dist/feature-libraries/indexing/anchorTreeIndex.js +12 -7
  181. package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  182. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  183. package/dist/feature-libraries/mitigatedChangeFamily.js +2 -2
  184. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  185. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +3 -3
  186. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  187. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  188. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +1 -0
  189. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -1
  190. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js +14 -6
  191. package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
  192. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +3 -3
  193. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  194. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  195. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  196. package/dist/feature-libraries/modular-schema/genericFieldKind.js +0 -1
  197. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  198. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +10 -10
  199. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  200. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +2 -4
  201. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  202. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +3 -3
  203. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  204. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  205. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +3 -3
  206. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  207. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  208. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -1
  209. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  210. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +11 -6
  211. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  212. package/dist/feature-libraries/object-forest/objectForest.d.ts +1 -1
  213. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  214. package/dist/feature-libraries/object-forest/objectForest.js +2 -2
  215. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  216. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +4 -4
  217. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  218. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  219. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts +3 -3
  220. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  221. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  222. package/dist/feature-libraries/schema-edits/index.d.ts +1 -1
  223. package/dist/feature-libraries/schema-edits/index.d.ts.map +1 -1
  224. package/dist/feature-libraries/schema-edits/index.js +2 -3
  225. package/dist/feature-libraries/schema-edits/index.js.map +1 -1
  226. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -15
  227. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  228. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +8 -54
  229. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  230. package/dist/feature-libraries/schema-index/codec.d.ts +3 -16
  231. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  232. package/dist/feature-libraries/schema-index/codec.js +1 -21
  233. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  234. package/dist/feature-libraries/schema-index/formatV2.d.ts +1 -1
  235. package/dist/feature-libraries/schema-index/formatV2.js +1 -1
  236. package/dist/feature-libraries/schema-index/formatV2.js.map +1 -1
  237. package/dist/feature-libraries/schema-index/index.d.ts +1 -1
  238. package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
  239. package/dist/feature-libraries/schema-index/index.js +1 -2
  240. package/dist/feature-libraries/schema-index/index.js.map +1 -1
  241. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +1 -1
  242. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  243. package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  244. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -4
  245. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  246. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  247. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +3 -3
  248. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  249. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  250. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +3 -3
  251. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  252. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  253. package/dist/index.d.ts +8 -2
  254. package/dist/index.d.ts.map +1 -1
  255. package/dist/index.js +4 -3
  256. package/dist/index.js.map +1 -1
  257. package/dist/packageVersion.d.ts +1 -1
  258. package/dist/packageVersion.js +1 -1
  259. package/dist/packageVersion.js.map +1 -1
  260. package/dist/shared-tree/independentView.d.ts +1 -1
  261. package/dist/shared-tree/independentView.d.ts.map +1 -1
  262. package/dist/shared-tree/independentView.js +14 -21
  263. package/dist/shared-tree/independentView.js.map +1 -1
  264. package/dist/shared-tree/index.d.ts +2 -2
  265. package/dist/shared-tree/index.d.ts.map +1 -1
  266. package/dist/shared-tree/index.js +1 -2
  267. package/dist/shared-tree/index.js.map +1 -1
  268. package/dist/shared-tree/schematizingTreeView.d.ts +2 -36
  269. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  270. package/dist/shared-tree/schematizingTreeView.js +15 -117
  271. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  272. package/dist/shared-tree/sharedTree.d.ts +3 -22
  273. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  274. package/dist/shared-tree/sharedTree.js +10 -27
  275. package/dist/shared-tree/sharedTree.js.map +1 -1
  276. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +3 -2
  277. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  278. package/dist/shared-tree/sharedTreeChangeCodecs.js +23 -16
  279. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  280. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  281. package/dist/shared-tree/sharedTreeChangeEnricher.js +1 -1
  282. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  283. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +1 -1
  284. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  285. package/dist/shared-tree/sharedTreeChangeFamily.js +2 -2
  286. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  287. package/dist/shared-tree/sharedTreeChangeFormat.d.ts +8 -7
  288. package/dist/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
  289. package/dist/shared-tree/sharedTreeChangeFormat.js +13 -5
  290. package/dist/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  291. package/dist/shared-tree/tree.d.ts.map +1 -1
  292. package/dist/shared-tree/tree.js +2 -1
  293. package/dist/shared-tree/tree.js.map +1 -1
  294. package/dist/shared-tree/treeAlpha.d.ts +13 -1
  295. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  296. package/dist/shared-tree/treeAlpha.js +3 -0
  297. package/dist/shared-tree/treeAlpha.js.map +1 -1
  298. package/dist/shared-tree/treeCheckout.d.ts +34 -69
  299. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  300. package/dist/shared-tree/treeCheckout.js +885 -677
  301. package/dist/shared-tree/treeCheckout.js.map +1 -1
  302. package/dist/shared-tree/unhydratedTreeContext.js +3 -3
  303. package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
  304. package/dist/shared-tree-core/editManagerCodecs.d.ts +23 -12
  305. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  306. package/dist/shared-tree-core/editManagerCodecs.js +40 -67
  307. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  308. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  309. package/dist/shared-tree-core/editManagerCodecsCommons.js +0 -1
  310. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  311. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +10 -2
  312. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  313. package/dist/shared-tree-core/editManagerCodecsV1toV4.js +18 -13
  314. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  315. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +2 -2
  316. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  317. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +6 -9
  318. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  319. package/dist/shared-tree-core/index.d.ts +3 -3
  320. package/dist/shared-tree-core/index.d.ts.map +1 -1
  321. package/dist/shared-tree-core/index.js +5 -8
  322. package/dist/shared-tree-core/index.js.map +1 -1
  323. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -3
  324. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  325. package/dist/shared-tree-core/messageCodecV1ToV4.js +8 -8
  326. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  327. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts +2 -3
  328. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  329. package/dist/shared-tree-core/messageCodecVSharedBranches.js +5 -4
  330. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  331. package/dist/shared-tree-core/messageCodecs.d.ts +15 -14
  332. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  333. package/dist/shared-tree-core/messageCodecs.js +38 -74
  334. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  335. package/dist/shared-tree-core/messageFormat.d.ts +0 -1
  336. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  337. package/dist/shared-tree-core/messageFormat.js +1 -2
  338. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  339. package/dist/shared-tree-core/sharedTreeCore.d.ts +1 -3
  340. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  341. package/dist/shared-tree-core/sharedTreeCore.js +12 -2
  342. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  343. package/dist/sharedTreeAttributes.d.ts.map +1 -1
  344. package/dist/sharedTreeAttributes.js +3 -0
  345. package/dist/sharedTreeAttributes.js.map +1 -1
  346. package/dist/simple-tree/api/eraseSchemaDetails.d.ts +43 -0
  347. package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  348. package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  349. package/dist/simple-tree/api/index.d.ts +4 -2
  350. package/dist/simple-tree/api/index.d.ts.map +1 -1
  351. package/dist/simple-tree/api/index.js.map +1 -1
  352. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  353. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  354. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +126 -29
  355. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  356. package/dist/simple-tree/api/schemaFactoryAlpha.js +72 -7
  357. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  358. package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  359. package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  360. package/dist/simple-tree/api/schemaStatics.d.ts +10 -11
  361. package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -1
  362. package/dist/simple-tree/api/schemaStatics.js +13 -7
  363. package/dist/simple-tree/api/schemaStatics.js.map +1 -1
  364. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  365. package/dist/simple-tree/api/storedSchema.js +6 -6
  366. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  367. package/dist/simple-tree/api/tree.d.ts +7 -19
  368. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  369. package/dist/simple-tree/api/tree.js.map +1 -1
  370. package/dist/simple-tree/api/treeAlpha.d.ts +69 -0
  371. package/dist/simple-tree/api/treeAlpha.d.ts.map +1 -0
  372. package/dist/simple-tree/api/treeAlpha.js +7 -0
  373. package/dist/simple-tree/api/treeAlpha.js.map +1 -0
  374. package/dist/simple-tree/api/treeBeta.d.ts +1 -1
  375. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  376. package/dist/simple-tree/api/treeChangeEvents.d.ts +3 -0
  377. package/dist/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
  378. package/dist/simple-tree/api/treeChangeEvents.js.map +1 -1
  379. package/dist/simple-tree/api/treeNodeApi.d.ts +49 -0
  380. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  381. package/dist/simple-tree/api/treeNodeApi.js +41 -2
  382. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  383. package/dist/simple-tree/api/typesUnsafe.d.ts +23 -2
  384. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  385. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  386. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  387. package/dist/simple-tree/core/treeNodeKernel.js +45 -8
  388. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  389. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  390. package/dist/simple-tree/core/unhydratedFlexTree.js +5 -1
  391. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  392. package/dist/simple-tree/fieldSchema.d.ts +3 -2
  393. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  394. package/dist/simple-tree/fieldSchema.js +3 -4
  395. package/dist/simple-tree/fieldSchema.js.map +1 -1
  396. package/dist/simple-tree/index.d.ts +2 -2
  397. package/dist/simple-tree/index.d.ts.map +1 -1
  398. package/dist/simple-tree/index.js.map +1 -1
  399. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +16 -0
  400. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  401. package/dist/simple-tree/node-kinds/array/arrayNode.js +23 -0
  402. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  403. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +10 -1
  404. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  405. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  406. package/dist/simple-tree/node-kinds/array/index.d.ts +2 -2
  407. package/dist/simple-tree/node-kinds/array/index.d.ts.map +1 -1
  408. package/dist/simple-tree/node-kinds/array/index.js.map +1 -1
  409. package/dist/simple-tree/node-kinds/index.d.ts +2 -2
  410. package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
  411. package/dist/simple-tree/node-kinds/index.js.map +1 -1
  412. package/dist/simple-tree/node-kinds/object/index.d.ts +2 -2
  413. package/dist/simple-tree/node-kinds/object/index.d.ts.map +1 -1
  414. package/dist/simple-tree/node-kinds/object/index.js.map +1 -1
  415. package/dist/simple-tree/node-kinds/object/objectNode.d.ts +43 -7
  416. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  417. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  418. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +26 -2
  419. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  420. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  421. package/dist/text/textDomainFormatted.d.ts +321 -13
  422. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  423. package/dist/text/textDomainFormatted.js +100 -25
  424. package/dist/text/textDomainFormatted.js.map +1 -1
  425. package/dist/treeFactory.d.ts.map +1 -1
  426. package/dist/treeFactory.js +5 -2
  427. package/dist/treeFactory.js.map +1 -1
  428. package/dist/util/rangeMap.d.ts +25 -18
  429. package/dist/util/rangeMap.d.ts.map +1 -1
  430. package/dist/util/rangeMap.js +24 -30
  431. package/dist/util/rangeMap.js.map +1 -1
  432. package/dist/util/referenceCounting.d.ts.map +1 -1
  433. package/dist/util/referenceCounting.js +0 -1
  434. package/dist/util/referenceCounting.js.map +1 -1
  435. package/dist/util/typeCheck.d.ts.map +1 -1
  436. package/dist/util/typeCheck.js.map +1 -1
  437. package/dist/util/typeUtils.d.ts.map +1 -1
  438. package/dist/util/typeUtils.js.map +1 -1
  439. package/eslint.config.mts +10 -2
  440. package/internal.d.ts +2 -2
  441. package/legacy.d.ts +2 -2
  442. package/lib/api.d.ts +6 -1
  443. package/lib/api.d.ts.map +1 -1
  444. package/lib/api.js.map +1 -1
  445. package/lib/codec/codec.d.ts +28 -2
  446. package/lib/codec/codec.d.ts.map +1 -1
  447. package/lib/codec/codec.js +1 -0
  448. package/lib/codec/codec.js.map +1 -1
  449. package/lib/codec/index.d.ts +2 -2
  450. package/lib/codec/index.d.ts.map +1 -1
  451. package/lib/codec/index.js +1 -1
  452. package/lib/codec/index.js.map +1 -1
  453. package/lib/codec/versioned/codec.d.ts +18 -36
  454. package/lib/codec/versioned/codec.d.ts.map +1 -1
  455. package/lib/codec/versioned/codec.js +45 -56
  456. package/lib/codec/versioned/codec.js.map +1 -1
  457. package/lib/codec/versioned/index.d.ts +1 -1
  458. package/lib/codec/versioned/index.d.ts.map +1 -1
  459. package/lib/codec/versioned/index.js +1 -1
  460. package/lib/codec/versioned/index.js.map +1 -1
  461. package/lib/core/forest/forest.d.ts +5 -2
  462. package/lib/core/forest/forest.d.ts.map +1 -1
  463. package/lib/core/forest/forest.js.map +1 -1
  464. package/lib/core/index.d.ts +1 -1
  465. package/lib/core/index.d.ts.map +1 -1
  466. package/lib/core/index.js +1 -1
  467. package/lib/core/index.js.map +1 -1
  468. package/lib/core/rebase/changeRebaser.d.ts +8 -1
  469. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  470. package/lib/core/rebase/changeRebaser.js.map +1 -1
  471. package/lib/core/rebase/revisionTagCodec.d.ts +4 -3
  472. package/lib/core/rebase/revisionTagCodec.d.ts.map +1 -1
  473. package/lib/core/rebase/revisionTagCodec.js +2 -0
  474. package/lib/core/rebase/revisionTagCodec.js.map +1 -1
  475. package/lib/core/rebase/utils.d.ts +2 -2
  476. package/lib/core/rebase/utils.d.ts.map +1 -1
  477. package/lib/core/rebase/utils.js +4 -4
  478. package/lib/core/rebase/utils.js.map +1 -1
  479. package/lib/core/schema-stored/formatV2.d.ts +1 -1
  480. package/lib/core/schema-stored/formatV2.js +1 -1
  481. package/lib/core/schema-stored/formatV2.js.map +1 -1
  482. package/lib/core/tree/anchorSet.d.ts +8 -0
  483. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  484. package/lib/core/tree/anchorSet.js +42 -7
  485. package/lib/core/tree/anchorSet.js.map +1 -1
  486. package/lib/core/tree/cursor.d.ts +25 -1
  487. package/lib/core/tree/cursor.d.ts.map +1 -1
  488. package/lib/core/tree/cursor.js +43 -0
  489. package/lib/core/tree/cursor.js.map +1 -1
  490. package/lib/core/tree/deltaUtil.d.ts +13 -1
  491. package/lib/core/tree/deltaUtil.d.ts.map +1 -1
  492. package/lib/core/tree/deltaUtil.js +31 -0
  493. package/lib/core/tree/deltaUtil.js.map +1 -1
  494. package/lib/core/tree/detachedFieldIndexCodecs.d.ts +5 -5
  495. package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  496. package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  497. package/lib/core/tree/index.d.ts +2 -2
  498. package/lib/core/tree/index.d.ts.map +1 -1
  499. package/lib/core/tree/index.js +2 -2
  500. package/lib/core/tree/index.js.map +1 -1
  501. package/lib/core/tree/visitDelta.d.ts +11 -0
  502. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  503. package/lib/core/tree/visitDelta.js +1 -1
  504. package/lib/core/tree/visitDelta.js.map +1 -1
  505. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  506. package/lib/core/tree/visitorUtils.js +5 -0
  507. package/lib/core/tree/visitorUtils.js.map +1 -1
  508. package/lib/entrypoints/alpha.d.ts +6 -0
  509. package/lib/entrypoints/alpha.d.ts.map +1 -0
  510. package/lib/entrypoints/alpha.js +12 -0
  511. package/lib/entrypoints/alpha.js.map +1 -0
  512. package/lib/entrypoints/beta.d.ts +6 -0
  513. package/lib/entrypoints/beta.d.ts.map +1 -0
  514. package/lib/entrypoints/beta.js +12 -0
  515. package/lib/entrypoints/beta.js.map +1 -0
  516. package/lib/entrypoints/internal.d.ts +6 -0
  517. package/lib/entrypoints/internal.d.ts.map +1 -0
  518. package/lib/entrypoints/internal.js +12 -0
  519. package/lib/entrypoints/internal.js.map +1 -0
  520. package/lib/entrypoints/legacy.d.ts +6 -0
  521. package/lib/entrypoints/legacy.d.ts.map +1 -0
  522. package/lib/entrypoints/legacy.js +15 -0
  523. package/lib/entrypoints/legacy.js.map +1 -0
  524. package/lib/entrypoints/public.d.ts +6 -0
  525. package/lib/entrypoints/public.d.ts.map +1 -0
  526. package/lib/entrypoints/public.js +10 -0
  527. package/lib/entrypoints/public.js.map +1 -0
  528. package/lib/feature-libraries/changeAtomIdCodec.d.ts +4 -3
  529. package/lib/feature-libraries/changeAtomIdCodec.d.ts.map +1 -1
  530. package/lib/feature-libraries/changeAtomIdCodec.js +2 -0
  531. package/lib/feature-libraries/changeAtomIdCodec.js.map +1 -1
  532. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +2 -1
  533. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  534. package/lib/feature-libraries/chunked-forest/chunkedForest.js +2 -2
  535. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  536. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +4 -4
  537. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  538. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +4 -4
  539. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  540. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
  541. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  542. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  543. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +1 -2
  544. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  545. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  546. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -4
  547. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  548. package/lib/feature-libraries/chunked-forest/codec/codecs.js +1 -1
  549. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  550. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +12 -12
  551. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  552. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -1
  553. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  554. package/lib/feature-libraries/chunked-forest/codec/{formatGeneric.d.ts → format/formatGeneric.d.ts} +1 -1
  555. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -0
  556. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -0
  557. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.d.ts +187 -0
  558. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.d.ts.map +1 -0
  559. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.js +112 -0
  560. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -0
  561. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.d.ts +33 -0
  562. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.d.ts.map +1 -0
  563. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.js +13 -0
  564. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -0
  565. package/lib/feature-libraries/chunked-forest/codec/format/index.d.ts +10 -0
  566. package/lib/feature-libraries/chunked-forest/codec/format/index.d.ts.map +1 -0
  567. package/lib/feature-libraries/chunked-forest/codec/format/index.js +8 -0
  568. package/lib/feature-libraries/chunked-forest/codec/format/index.js.map +1 -0
  569. package/lib/feature-libraries/chunked-forest/codec/format/versions.d.ts +93 -0
  570. package/lib/feature-libraries/chunked-forest/codec/format/versions.d.ts.map +1 -0
  571. package/lib/feature-libraries/chunked-forest/codec/format/versions.js +26 -0
  572. package/lib/feature-libraries/chunked-forest/codec/format/versions.js.map +1 -0
  573. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
  574. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  575. package/lib/feature-libraries/chunked-forest/codec/index.js +1 -1
  576. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  577. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +7 -7
  578. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
  579. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  580. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
  581. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  582. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +4 -2
  583. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  584. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +1 -1
  585. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  586. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +1 -1
  587. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  588. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  589. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  590. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  591. package/lib/feature-libraries/cursorComparator.d.ts +23 -0
  592. package/lib/feature-libraries/cursorComparator.d.ts.map +1 -0
  593. package/lib/feature-libraries/cursorComparator.js +61 -0
  594. package/lib/feature-libraries/cursorComparator.js.map +1 -0
  595. package/lib/feature-libraries/forest-summary/codec.d.ts +1 -1
  596. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +3 -3
  597. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  598. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  599. package/lib/feature-libraries/index.d.ts +3 -2
  600. package/lib/feature-libraries/index.d.ts.map +1 -1
  601. package/lib/feature-libraries/index.js +3 -2
  602. package/lib/feature-libraries/index.js.map +1 -1
  603. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts +2 -0
  604. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  605. package/lib/feature-libraries/indexing/anchorTreeIndex.js +12 -7
  606. package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  607. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  608. package/lib/feature-libraries/mitigatedChangeFamily.js +2 -2
  609. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  610. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +3 -3
  611. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  612. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  613. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +1 -0
  614. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -1
  615. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js +14 -6
  616. package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
  617. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +3 -3
  618. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  619. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  620. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  621. package/lib/feature-libraries/modular-schema/genericFieldKind.js +0 -1
  622. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  623. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +10 -10
  624. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  625. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +2 -4
  626. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  627. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +3 -3
  628. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  629. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  630. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +3 -3
  631. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  632. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  633. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -1
  634. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  635. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +11 -6
  636. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  637. package/lib/feature-libraries/object-forest/objectForest.d.ts +1 -1
  638. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  639. package/lib/feature-libraries/object-forest/objectForest.js +2 -2
  640. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  641. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +4 -4
  642. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  643. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +1 -1
  644. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  645. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts +3 -3
  646. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  647. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  648. package/lib/feature-libraries/schema-edits/index.d.ts +1 -1
  649. package/lib/feature-libraries/schema-edits/index.d.ts.map +1 -1
  650. package/lib/feature-libraries/schema-edits/index.js +1 -1
  651. package/lib/feature-libraries/schema-edits/index.js.map +1 -1
  652. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -15
  653. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  654. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +6 -50
  655. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  656. package/lib/feature-libraries/schema-index/codec.d.ts +3 -16
  657. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  658. package/lib/feature-libraries/schema-index/codec.js +0 -19
  659. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  660. package/lib/feature-libraries/schema-index/formatV2.d.ts +1 -1
  661. package/lib/feature-libraries/schema-index/formatV2.js +1 -1
  662. package/lib/feature-libraries/schema-index/formatV2.js.map +1 -1
  663. package/lib/feature-libraries/schema-index/index.d.ts +1 -1
  664. package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
  665. package/lib/feature-libraries/schema-index/index.js +1 -1
  666. package/lib/feature-libraries/schema-index/index.js.map +1 -1
  667. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +1 -1
  668. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  669. package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  670. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -4
  671. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  672. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  673. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +3 -3
  674. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  675. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +1 -1
  676. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  677. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +3 -3
  678. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  679. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  680. package/lib/index.d.ts +8 -2
  681. package/lib/index.d.ts.map +1 -1
  682. package/lib/index.js +9 -1
  683. package/lib/index.js.map +1 -1
  684. package/lib/packageVersion.d.ts +1 -1
  685. package/lib/packageVersion.js +1 -1
  686. package/lib/packageVersion.js.map +1 -1
  687. package/lib/shared-tree/independentView.d.ts +1 -1
  688. package/lib/shared-tree/independentView.d.ts.map +1 -1
  689. package/lib/shared-tree/independentView.js +4 -11
  690. package/lib/shared-tree/independentView.js.map +1 -1
  691. package/lib/shared-tree/index.d.ts +2 -2
  692. package/lib/shared-tree/index.d.ts.map +1 -1
  693. package/lib/shared-tree/index.js +1 -1
  694. package/lib/shared-tree/index.js.map +1 -1
  695. package/lib/shared-tree/schematizingTreeView.d.ts +2 -36
  696. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  697. package/lib/shared-tree/schematizingTreeView.js +17 -116
  698. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  699. package/lib/shared-tree/sharedTree.d.ts +3 -22
  700. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  701. package/lib/shared-tree/sharedTree.js +11 -27
  702. package/lib/shared-tree/sharedTree.js.map +1 -1
  703. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +3 -2
  704. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  705. package/lib/shared-tree/sharedTreeChangeCodecs.js +19 -12
  706. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  707. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  708. package/lib/shared-tree/sharedTreeChangeEnricher.js +2 -2
  709. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  710. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +1 -1
  711. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  712. package/lib/shared-tree/sharedTreeChangeFamily.js +2 -2
  713. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  714. package/lib/shared-tree/sharedTreeChangeFormat.d.ts +8 -7
  715. package/lib/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
  716. package/lib/shared-tree/sharedTreeChangeFormat.js +11 -5
  717. package/lib/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  718. package/lib/shared-tree/tree.d.ts.map +1 -1
  719. package/lib/shared-tree/tree.js +2 -1
  720. package/lib/shared-tree/tree.js.map +1 -1
  721. package/lib/shared-tree/treeAlpha.d.ts +13 -1
  722. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  723. package/lib/shared-tree/treeAlpha.js +3 -0
  724. package/lib/shared-tree/treeAlpha.js.map +1 -1
  725. package/lib/shared-tree/treeCheckout.d.ts +34 -69
  726. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  727. package/lib/shared-tree/treeCheckout.js +889 -682
  728. package/lib/shared-tree/treeCheckout.js.map +1 -1
  729. package/lib/shared-tree/unhydratedTreeContext.js +1 -1
  730. package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
  731. package/lib/shared-tree-core/editManagerCodecs.d.ts +23 -12
  732. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  733. package/lib/shared-tree-core/editManagerCodecs.js +41 -65
  734. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  735. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  736. package/lib/shared-tree-core/editManagerCodecsCommons.js +0 -1
  737. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  738. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +10 -2
  739. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  740. package/lib/shared-tree-core/editManagerCodecsV1toV4.js +16 -11
  741. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  742. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +2 -2
  743. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  744. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +5 -8
  745. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  746. package/lib/shared-tree-core/index.d.ts +3 -3
  747. package/lib/shared-tree-core/index.d.ts.map +1 -1
  748. package/lib/shared-tree-core/index.js +3 -3
  749. package/lib/shared-tree-core/index.js.map +1 -1
  750. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -3
  751. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  752. package/lib/shared-tree-core/messageCodecV1ToV4.js +8 -8
  753. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  754. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts +2 -3
  755. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  756. package/lib/shared-tree-core/messageCodecVSharedBranches.js +5 -4
  757. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  758. package/lib/shared-tree-core/messageCodecs.d.ts +15 -14
  759. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  760. package/lib/shared-tree-core/messageCodecs.js +38 -71
  761. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  762. package/lib/shared-tree-core/messageFormat.d.ts +0 -1
  763. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  764. package/lib/shared-tree-core/messageFormat.js +0 -1
  765. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  766. package/lib/shared-tree-core/sharedTreeCore.d.ts +1 -3
  767. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  768. package/lib/shared-tree-core/sharedTreeCore.js +14 -4
  769. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  770. package/lib/sharedTreeAttributes.d.ts.map +1 -1
  771. package/lib/sharedTreeAttributes.js +3 -0
  772. package/lib/sharedTreeAttributes.js.map +1 -1
  773. package/lib/simple-tree/api/eraseSchemaDetails.d.ts +43 -0
  774. package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
  775. package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -1
  776. package/lib/simple-tree/api/index.d.ts +4 -2
  777. package/lib/simple-tree/api/index.d.ts.map +1 -1
  778. package/lib/simple-tree/api/index.js +1 -1
  779. package/lib/simple-tree/api/index.js.map +1 -1
  780. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  781. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  782. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +126 -29
  783. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  784. package/lib/simple-tree/api/schemaFactoryAlpha.js +66 -1
  785. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  786. package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  787. package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  788. package/lib/simple-tree/api/schemaStatics.d.ts +10 -11
  789. package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -1
  790. package/lib/simple-tree/api/schemaStatics.js +14 -8
  791. package/lib/simple-tree/api/schemaStatics.js.map +1 -1
  792. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  793. package/lib/simple-tree/api/storedSchema.js +7 -7
  794. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  795. package/lib/simple-tree/api/tree.d.ts +7 -19
  796. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  797. package/lib/simple-tree/api/tree.js.map +1 -1
  798. package/lib/simple-tree/api/treeAlpha.d.ts +69 -0
  799. package/lib/simple-tree/api/treeAlpha.d.ts.map +1 -0
  800. package/lib/simple-tree/api/treeAlpha.js +6 -0
  801. package/lib/simple-tree/api/treeAlpha.js.map +1 -0
  802. package/lib/simple-tree/api/treeBeta.d.ts +1 -1
  803. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  804. package/lib/simple-tree/api/treeChangeEvents.d.ts +3 -0
  805. package/lib/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
  806. package/lib/simple-tree/api/treeChangeEvents.js.map +1 -1
  807. package/lib/simple-tree/api/treeNodeApi.d.ts +49 -0
  808. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  809. package/lib/simple-tree/api/treeNodeApi.js +41 -2
  810. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  811. package/lib/simple-tree/api/typesUnsafe.d.ts +23 -2
  812. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  813. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  814. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  815. package/lib/simple-tree/core/treeNodeKernel.js +45 -8
  816. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  817. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  818. package/lib/simple-tree/core/unhydratedFlexTree.js +5 -1
  819. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  820. package/lib/simple-tree/fieldSchema.d.ts +3 -2
  821. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  822. package/lib/simple-tree/fieldSchema.js +3 -4
  823. package/lib/simple-tree/fieldSchema.js.map +1 -1
  824. package/lib/simple-tree/index.d.ts +2 -2
  825. package/lib/simple-tree/index.d.ts.map +1 -1
  826. package/lib/simple-tree/index.js.map +1 -1
  827. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +16 -0
  828. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  829. package/lib/simple-tree/node-kinds/array/arrayNode.js +23 -0
  830. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  831. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +10 -1
  832. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  833. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  834. package/lib/simple-tree/node-kinds/array/index.d.ts +2 -2
  835. package/lib/simple-tree/node-kinds/array/index.d.ts.map +1 -1
  836. package/lib/simple-tree/node-kinds/array/index.js.map +1 -1
  837. package/lib/simple-tree/node-kinds/index.d.ts +2 -2
  838. package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
  839. package/lib/simple-tree/node-kinds/index.js.map +1 -1
  840. package/lib/simple-tree/node-kinds/object/index.d.ts +2 -2
  841. package/lib/simple-tree/node-kinds/object/index.d.ts.map +1 -1
  842. package/lib/simple-tree/node-kinds/object/index.js.map +1 -1
  843. package/lib/simple-tree/node-kinds/object/objectNode.d.ts +43 -7
  844. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  845. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  846. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +26 -2
  847. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  848. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  849. package/lib/text/textDomainFormatted.d.ts +321 -13
  850. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  851. package/lib/text/textDomainFormatted.js +103 -28
  852. package/lib/text/textDomainFormatted.js.map +1 -1
  853. package/lib/treeFactory.d.ts.map +1 -1
  854. package/lib/treeFactory.js +6 -3
  855. package/lib/treeFactory.js.map +1 -1
  856. package/lib/util/rangeMap.d.ts +25 -18
  857. package/lib/util/rangeMap.d.ts.map +1 -1
  858. package/lib/util/rangeMap.js +25 -31
  859. package/lib/util/rangeMap.js.map +1 -1
  860. package/lib/util/referenceCounting.d.ts.map +1 -1
  861. package/lib/util/referenceCounting.js +0 -1
  862. package/lib/util/referenceCounting.js.map +1 -1
  863. package/lib/util/typeCheck.d.ts.map +1 -1
  864. package/lib/util/typeCheck.js.map +1 -1
  865. package/lib/util/typeUtils.d.ts.map +1 -1
  866. package/lib/util/typeUtils.js.map +1 -1
  867. package/package.json +50 -50
  868. package/scripts/generate-entrypoint-sources.sh +31 -0
  869. package/src/api.ts +11 -0
  870. package/src/codec/codec.ts +32 -2
  871. package/src/codec/index.ts +2 -3
  872. package/src/codec/versioned/codec.ts +99 -109
  873. package/src/codec/versioned/index.ts +1 -3
  874. package/src/core/forest/forest.ts +5 -2
  875. package/src/core/index.ts +4 -0
  876. package/src/core/rebase/changeRebaser.ts +8 -0
  877. package/src/core/rebase/revisionTagCodec.ts +4 -4
  878. package/src/core/rebase/utils.ts +9 -2
  879. package/src/core/schema-stored/formatV2.ts +1 -1
  880. package/src/core/tree/anchorSet.ts +67 -10
  881. package/src/core/tree/cursor.ts +52 -1
  882. package/src/core/tree/deltaUtil.ts +37 -1
  883. package/src/core/tree/detachedFieldIndexCodecs.ts +4 -4
  884. package/src/core/tree/index.ts +4 -0
  885. package/src/core/tree/visitDelta.ts +13 -1
  886. package/src/core/tree/visitorUtils.ts +5 -0
  887. package/{dist/alpha.d.ts → src/entrypoints/alpha.ts} +25 -11
  888. package/{lib/beta.d.ts → src/entrypoints/beta.ts} +4 -7
  889. package/src/entrypoints/internal.ts +13 -0
  890. package/{lib/legacy.d.ts → src/entrypoints/legacy.ts} +13 -8
  891. package/{dist/public.d.ts → src/entrypoints/public.ts} +3 -6
  892. package/src/feature-libraries/changeAtomIdCodec.ts +8 -7
  893. package/src/feature-libraries/chunked-forest/chunkedForest.ts +3 -2
  894. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +18 -13
  895. package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +1 -1
  896. package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +1 -2
  897. package/src/feature-libraries/chunked-forest/codec/codecs.ts +16 -10
  898. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +16 -14
  899. package/src/feature-libraries/chunked-forest/codec/{formatGeneric.ts → format/formatGeneric.ts} +1 -1
  900. package/src/feature-libraries/chunked-forest/codec/{format.ts → format/formatV1.ts} +41 -111
  901. package/src/feature-libraries/chunked-forest/codec/format/formatV2.ts +31 -0
  902. package/src/feature-libraries/chunked-forest/codec/format/index.ts +31 -0
  903. package/src/feature-libraries/chunked-forest/codec/format/versions.ts +81 -0
  904. package/src/feature-libraries/chunked-forest/codec/index.ts +6 -2
  905. package/src/feature-libraries/chunked-forest/codec/nodeEncoder.ts +19 -12
  906. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +6 -4
  907. package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +10 -10
  908. package/src/feature-libraries/chunked-forest/index.ts +2 -1
  909. package/src/feature-libraries/cursorComparator.ts +77 -0
  910. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +5 -5
  911. package/src/feature-libraries/index.ts +5 -3
  912. package/src/feature-libraries/indexing/anchorTreeIndex.ts +20 -10
  913. package/src/feature-libraries/mitigatedChangeFamily.ts +4 -1
  914. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +3 -8
  915. package/src/feature-libraries/modular-schema/defaultRevisionReplacer.ts +16 -8
  916. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +4 -5
  917. package/src/feature-libraries/modular-schema/genericFieldKind.ts +0 -1
  918. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +19 -26
  919. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +4 -4
  920. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +4 -5
  921. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +15 -6
  922. package/src/feature-libraries/object-forest/objectForest.ts +8 -2
  923. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +11 -13
  924. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +4 -5
  925. package/src/feature-libraries/schema-edits/index.ts +1 -4
  926. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +10 -78
  927. package/src/feature-libraries/schema-index/codec.ts +0 -25
  928. package/src/feature-libraries/schema-index/formatV2.ts +1 -1
  929. package/src/feature-libraries/schema-index/index.ts +1 -4
  930. package/src/feature-libraries/sequence-field/moveEffectTable.ts +1 -1
  931. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +6 -6
  932. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +8 -5
  933. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +4 -5
  934. package/src/index.ts +29 -3
  935. package/src/packageVersion.ts +1 -1
  936. package/src/shared-tree/independentView.ts +5 -18
  937. package/src/shared-tree/index.ts +0 -4
  938. package/src/shared-tree/schematizingTreeView.ts +19 -165
  939. package/src/shared-tree/sharedTree.ts +16 -59
  940. package/src/shared-tree/sharedTreeChangeCodecs.ts +23 -29
  941. package/src/shared-tree/sharedTreeChangeEnricher.ts +1 -2
  942. package/src/shared-tree/sharedTreeChangeFamily.ts +2 -0
  943. package/src/shared-tree/sharedTreeChangeFormat.ts +23 -8
  944. package/src/shared-tree/tree.ts +2 -5
  945. package/src/shared-tree/treeAlpha.ts +26 -0
  946. package/src/shared-tree/treeCheckout.ts +277 -100
  947. package/src/shared-tree/unhydratedTreeContext.ts +1 -1
  948. package/src/shared-tree-core/editManagerCodecs.ts +99 -124
  949. package/src/shared-tree-core/editManagerCodecsCommons.ts +0 -1
  950. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +54 -59
  951. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +72 -95
  952. package/src/shared-tree-core/index.ts +4 -8
  953. package/src/shared-tree-core/messageCodecV1ToV4.ts +56 -71
  954. package/src/shared-tree-core/messageCodecVSharedBranches.ts +76 -92
  955. package/src/shared-tree-core/messageCodecs.ts +88 -126
  956. package/src/shared-tree-core/messageFormat.ts +0 -3
  957. package/src/shared-tree-core/sharedTreeCore.ts +14 -21
  958. package/src/sharedTreeAttributes.ts +3 -0
  959. package/src/simple-tree/api/eraseSchemaDetails.ts +60 -0
  960. package/src/simple-tree/api/index.ts +22 -1
  961. package/src/simple-tree/api/schemaFactory.ts +8 -3
  962. package/src/simple-tree/api/schemaFactoryAlpha.ts +275 -27
  963. package/src/simple-tree/api/schemaFactoryBeta.ts +10 -1
  964. package/src/simple-tree/api/schemaStatics.ts +79 -21
  965. package/src/simple-tree/api/storedSchema.ts +8 -19
  966. package/src/simple-tree/api/tree.ts +7 -20
  967. package/src/simple-tree/api/treeAlpha.ts +90 -0
  968. package/src/simple-tree/api/treeBeta.ts +1 -1
  969. package/src/simple-tree/api/treeChangeEvents.ts +3 -0
  970. package/src/simple-tree/api/treeNodeApi.ts +95 -3
  971. package/src/simple-tree/api/typesUnsafe.ts +49 -1
  972. package/src/simple-tree/core/treeNodeKernel.ts +53 -7
  973. package/src/simple-tree/core/unhydratedFlexTree.ts +5 -1
  974. package/src/simple-tree/fieldSchema.ts +29 -5
  975. package/src/simple-tree/index.ts +20 -0
  976. package/src/simple-tree/node-kinds/array/arrayNode.ts +64 -0
  977. package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +25 -1
  978. package/src/simple-tree/node-kinds/array/index.ts +2 -0
  979. package/src/simple-tree/node-kinds/index.ts +5 -0
  980. package/src/simple-tree/node-kinds/object/index.ts +3 -0
  981. package/src/simple-tree/node-kinds/object/objectNode.ts +69 -11
  982. package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +33 -2
  983. package/src/text/textDomainFormatted.ts +113 -11
  984. package/src/treeFactory.ts +10 -5
  985. package/src/util/rangeMap.ts +54 -50
  986. package/src/util/referenceCounting.ts +0 -1
  987. package/src/util/typeCheck.ts +1 -0
  988. package/src/util/typeUtils.ts +4 -7
  989. package/dist/beta.d.ts +0 -152
  990. package/dist/feature-libraries/chunked-forest/codec/format.d.ts +0 -383
  991. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +0 -1
  992. package/dist/feature-libraries/chunked-forest/codec/format.js +0 -191
  993. package/dist/feature-libraries/chunked-forest/codec/format.js.map +0 -1
  994. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +0 -1
  995. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js.map +0 -1
  996. package/dist/legacy.d.ts +0 -159
  997. package/lib/alpha.d.ts +0 -304
  998. package/lib/feature-libraries/chunked-forest/codec/format.d.ts +0 -383
  999. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +0 -1
  1000. package/lib/feature-libraries/chunked-forest/codec/format.js +0 -188
  1001. package/lib/feature-libraries/chunked-forest/codec/format.js.map +0 -1
  1002. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +0 -1
  1003. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js.map +0 -1
  1004. package/lib/public.d.ts +0 -94
  1005. /package/dist/feature-libraries/chunked-forest/codec/{formatGeneric.js → format/formatGeneric.js} +0 -0
  1006. /package/lib/feature-libraries/chunked-forest/codec/{formatGeneric.js → format/formatGeneric.js} +0 -0
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAcyB;AAbxB,uGAAA,WAAW,OAAA;AAEX,sGAAA,UAAU,OAAA;AACV,4GAAA,gBAAgB,OAAA;AA4CjB,yDAMsC;AALrC,sGAAA,UAAU,OAAA;AACV,mHAAA,uBAAuB,OAAA;AAMxB,mDAyBgC;AAnB/B,gGAAA,IAAI,OAAA;AAGJ,qGAAA,SAAS,OAAA;AAGT,sHAAA,0BAA0B,OAAA;AAE1B,qGAAA,SAAS,OAAA;AAGT,2GAAA,eAAe,OAAA;AAEf,qHAAA,yBAAyB,OAAA;AACzB,sHAAA,0BAA0B,OAAA;AAE1B,+GAAA,mBAAmB,OAAA;AACnB,oHAAA,wBAAwB,OAAA;AACxB,+GAAA,mBAAmB,OAAA;AAGpB,mDA8NgC;AA7N/B,yGAAA,aAAa,OAAA;AAEb,oHAAA,wBAAwB,OAAA;AACxB,oGAAA,QAAQ,OAAA;AAIR,iHAAA,qBAAqB,OAAA;AAKrB,yGAAA,aAAa,OAAA;AACb,6GAAA,iBAAiB,OAAA;AAEjB,8GAAA,kBAAkB,OAAA;AAUlB,qGAAA,SAAS,OAAA;AACT,uGAAA,WAAW,OAAA;AAMX,oGAAA,QAAQ,OAAA;AAER,4GAAA,gBAAgB,OAAA;AAMhB,gHAAA,oBAAoB,OAAA;AAKpB,+GAAA,mBAAmB,OAAA;AA8BnB,2GAAA,eAAe,OAAA;AACf,iHAAA,qBAAqB,OAAA;AAErB,2GAAA,eAAe,OAAA;AAGf,4BAA4B;AAC5B,qGAAA,SAAS,OAAA;AACT,2GAAA,eAAe,OAAA;AACf,2GAAA,eAAe,OAAA;AAqBf,YAAY;AACZ,oGAAA,QAAQ,OAAA;AAO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A,oBAAoB,OAAA;AAwB7B,4CAAwD;AAA/C,iHAAA,qBAAqB,OAAA;AAE9B,kEAAoD;AAM3C,sCAAa;AAOtB,6DAAmD;AAA1C,iHAAA,UAAU,OAAA;AACnB,6EAAwE;AAA/D,sIAAA,uBAAuB,OAAA;AAChC,mDAAwE;AAA/D,6GAAA,WAAW,OAAA;AACpB,mCAA2C;AAAlC,iGAAA,OAAO,OAAA;AAAE,gGAAA,MAAM,OAAA;AAExB,4CAAkE;AAAzD,sGAAA,UAAU,OAAA;AAAE,+GAAA,mBAAmB,OAAA;AACxC,mEAA+D;AAAtD,6HAAA,mBAAmB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tValueSchema,\n\ttype Revertible,\n\tCommitKind,\n\tRevertibleStatus,\n\ttype CommitMetadata,\n\ttype LocalChangeMetadata,\n\ttype RemoteChangeMetadata,\n\ttype ChangeMetadata,\n\ttype LabelTree,\n\ttype TransactionLabels,\n\ttype RevertibleFactory,\n\ttype RevertibleAlphaFactory,\n\ttype RevertibleAlpha,\n} from \"./core/index.js\";\n\nimport type {\n\tListeners as EventListeners,\n\tIsListener as EventIsListener,\n\tListenable as EventListenable,\n\tOff as EventOff,\n} from \"@fluidframework/core-interfaces\";\n\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Listeners}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Listeners<T extends object> = EventListeners<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#IsListener}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type IsListener<T> = EventIsListener<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Listenable}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Listenable<T extends object> = EventListenable<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Off}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Off = EventOff;\n\nexport {\n\tTreeStatus,\n\tTreeCompressionStrategy,\n\ttype TreeIndex,\n\ttype TreeIndexNodes,\n\ttype IncrementalEncodingPolicy,\n} from \"./feature-libraries/index.js\";\n\nexport {\n\ttype ITreeInternal,\n\ttype SharedTreeOptions,\n\ttype SharedTreeOptionsBeta,\n\ttype ForestType,\n\ttype SharedTreeFormatOptions,\n\tTree,\n\ttype RunTransaction,\n\ttype ForestOptions,\n\tgetBranch,\n\ttype BranchableTree,\n\ttype TreeBranchFork,\n\tindependentInitializedView,\n\ttype ViewContent,\n\tTreeAlpha,\n\ttype ObservationResults,\n\ttype TreeIdentifierUtils,\n\tindependentView,\n\ttype IndependentViewOptions,\n\tcreateIndependentTreeBeta,\n\tcreateIndependentTreeAlpha,\n\ttype CreateIndependentTreeAlphaOptions,\n\tForestTypeOptimized,\n\tForestTypeExpensiveDebug,\n\tForestTypeReference,\n} from \"./shared-tree/index.js\";\n\nexport {\n\tTreeArrayNode,\n\ttype Unhydrated,\n\tIterableTreeArrayContent,\n\tTreeNode,\n\ttype ViewableTree,\n\ttype ITree,\n\ttype TreeNodeSchema,\n\tTreeViewConfiguration,\n\ttype ITreeViewConfiguration,\n\ttype ITreeConfigurationOptions,\n\ttype TreeView,\n\ttype TreeViewEvents,\n\tSchemaFactory,\n\tSchemaFactoryBeta,\n\ttype SchemaStaticsBeta,\n\tSchemaFactoryAlpha,\n\ttype ObjectSchemaOptionsAlpha,\n\ttype ObjectSchemaOptions,\n\ttype ImplicitFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\ttype TreeChangeEvents,\n\ttype NodeFromSchema,\n\ttype TreeMapNode,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\tFieldKind,\n\tFieldSchema,\n\ttype FieldSchemaAlpha,\n\ttype FieldSchemaMetadata,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InsertableTypedNode,\n\tNodeKind,\n\ttype TreeObjectNode,\n\tObjectNodeSchema,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype TreeNodeSchemaClass,\n\ttype SchemaCompatibilityStatus,\n\ttype FieldProps,\n\ttype FieldPropsAlpha,\n\tnormalizeFieldSchema,\n\ttype InternalTreeNode,\n\ttype WithType,\n\ttype NodeChangedData,\n\ttype SchemaUpgrade,\n\tcontentSchemaSymbol,\n\t// Types not really intended for public use, but used in links.\n\t// Can not be moved to internalTypes since doing so causes app code to throw errors like:\n\t// Error: src/simple-tree/objectNode.ts:72:1 - (ae-unresolved-link) The @link reference could not be resolved: The package \"@fluidframework/tree\" does not have an export \"TreeNodeApi\"\n\ttype TreeNodeApi,\n\ttype TreeNodeSchemaCore,\n\t// Types not really intended for public use, but used in inferred types exposed in the public API.\n\t// Can not be moved to internalTypes since doing so causes app code to throw errors like:\n\t// error TS2742: The inferred type of 'Inventory' cannot be named without a reference to '../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.\n\ttype AllowedTypes,\n\ttype System_Unsafe,\n\ttype FieldSchemaAlphaUnsafe,\n\ttype ArrayNodeCustomizableSchemaUnsafe,\n\ttype MapNodeCustomizableSchemaUnsafe,\n\ttype TreeRecordNodeUnsafe,\n\ttype UnannotateAllowedTypeUnsafe,\n\ttype AnnotatedAllowedTypeUnsafe,\n\ttype AnnotatedAllowedTypesUnsafe,\n\ttype AllowedTypesFullUnsafe,\n\ttype AllowedTypesFullFromMixedUnsafe,\n\ttype UnannotateAllowedTypesListUnsafe,\n\ttype AnnotateAllowedTypesListUnsafe,\n\t// System types (not in Internal types for various reasons, like doc links or cannot be named errors).\n\ttype typeSchemaSymbol,\n\ttype TreeNodeSchemaNonClass,\n\t// Recursive Schema APIs\n\ttype ValidateRecursiveSchema,\n\ttype FixRecursiveArraySchema,\n\t// Index APIs\n\ttype IdentifierIndex,\n\tcreateTreeIndex,\n\tcreateIdentifierIndex,\n\ttype DirtyTreeStatus,\n\ttrackDirtyNodes,\n\ttype DirtyTreeMap,\n\ttype TreeIndexKey,\n\t// experimental @alpha APIs:\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttype UnsafeUnknownSchema,\n\ttype TreeViewAlpha,\n\ttype TreeViewBeta,\n\ttype InsertableField,\n\ttype Insertable,\n\ttype InsertableContent,\n\ttype FactoryContent,\n\ttype FactoryContentObject,\n\ttype ReadableField,\n\ttype ReadSchema,\n\ttype AnnotatedAllowedType,\n\ttype AnnotatedAllowedTypes,\n\ttype AllowedTypesFullEvaluated,\n\ttype AllowedTypeMetadata,\n\ttype AllowedTypesMetadata,\n\ttype UnannotateAllowedTypesList,\n\ttype AnnotateAllowedTypesList,\n\ttype AllowedTypesFull,\n\ttype AllowedTypesFullFromMixed,\n\ttype SchemaType,\n\t// Beta APIs\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n\t// Other\n\ttype VerboseTreeNode,\n\ttype TreeEncodingOptions,\n\ttype TreeSchemaEncodingOptions,\n\ttype TreeSchema,\n\tTreeViewConfigurationAlpha,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n\ttype ConciseTree,\n\t// Back to normal types\n\ttype JsonTreeSchema,\n\ttype JsonSchemaId,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonLeafNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonObjectNodeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonSchemaType,\n\ttype JsonLeafSchemaType,\n\ttype JsonRecordNodeSchema,\n\ttype JsonStringKeyPatternProperties,\n\tgetJsonSchema,\n\ttype LazyItem,\n\ttype Unenforced,\n\ttype SimpleNodeSchemaBase,\n\ttype SimpleNodeSchemaBaseAlpha,\n\ttype SimpleTreeSchema,\n\ttype SimpleNodeSchema,\n\ttype SimpleFieldSchema,\n\ttype SimpleLeafNodeSchema,\n\ttype SimpleMapNodeSchema,\n\ttype SimpleArrayNodeSchema,\n\ttype SimpleObjectNodeSchema,\n\ttype SimpleObjectFieldSchema,\n\ttype SimpleRecordNodeSchema,\n\tnormalizeAllowedTypes,\n\twalkFieldSchema,\n\twalkNodeSchema,\n\twalkAllowedTypes,\n\ttype SchemaVisitor,\n\tgetSimpleSchema,\n\ttype ReadonlyArrayNode,\n\ttype InsertableTreeNodeFromAllowedTypes,\n\ttype Input,\n\ttype TreeBranch,\n\ttype TreeBranchAlpha,\n\ttype TreeBranchEvents,\n\tasTreeViewAlpha,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaOptionsAlpha,\n\ttype NodeSchemaMetadata,\n\ttype SchemaStatics,\n\ttype ITreeAlpha,\n\ttype TransactionConstraint,\n\ttype TransactionConstraintAlpha,\n\ttype NodeInDocumentConstraint,\n\ttype NoChangeConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n\tgenerateSchemaFromSimpleSchema,\n\tevaluateLazySchema,\n\treplaceConciseTreeHandles,\n\treplaceHandles,\n\treplaceVerboseTreeHandles,\n\ttype HandleConverter,\n\tallowUnused,\n\ttype LeafSchema,\n\ttype ArrayNodeCustomizableSchema,\n\ttype ArrayNodePojoEmulationSchema,\n\tArrayNodeSchema,\n\ttype MapNodeCustomizableSchema,\n\ttype MapNodePojoEmulationSchema,\n\tMapNodeSchema,\n\ttype ObjectFromSchemaRecord,\n\ttype ValidateRecursiveSchemaTemplate,\n\ttype FixRecursiveRecursionLimit,\n\tRecordNodeSchema,\n\ttype RecordNodeCustomizableSchema,\n\ttype RecordNodeInsertableData,\n\ttype RecordNodePojoEmulationSchema,\n\ttype TreeRecordNode,\n\tKeyEncodingOptions,\n\ttype TreeParsingOptions,\n\ttype SchemaFactory_base,\n\ttype NumberKeys,\n\ttype SimpleAllowedTypeAttributes,\n\tencodeSchemaCompatibilitySnapshot,\n\tdecodeSchemaCompatibilitySnapshot,\n\texportCompatibilitySchemaSnapshot,\n\timportCompatibilitySchemaSnapshot,\n\tcheckCompatibility,\n\tsnapshotSchemaCompatibility,\n\ttype SnapshotFileSystem,\n\tincrementalSummaryHint,\n\tincrementalEncodingPolicyForAllowedTypes,\n\teraseSchemaDetails,\n\teraseSchemaDetailsSubclassable,\n\ttype SnapshotSchemaCompatibilityOptions,\n\ttype ArrayPlaceAnchor,\n\tcreateArrayInsertionAnchor,\n\ttype WithValue,\n\ttype TreeContextAlpha,\n} from \"./simple-tree/index.js\";\nexport {\n\tSharedTree,\n\tconfiguredSharedTree,\n\tconfiguredSharedTreeAlpha,\n\tconfiguredSharedTreeBeta,\n\tconfiguredSharedTreeBetaLegacy,\n} from \"./treeFactory.js\";\nexport { SharedTreeAttributes, SharedTreeFactoryType } from \"./sharedTreeAttributes.js\";\nexport { persistedToSimpleSchema } from \"./shared-tree/index.js\";\n\nexport {\n\ttype ICodecOptions,\n\ttype CodecWriteOptions,\n\ttype CodecWriteOptionsBeta,\n\tFluidClientVersion,\n\ttype FormatValidator,\n\tFormatValidatorNoOp,\n\ttype CodecName,\n\ttype FormatVersion,\n} from \"./codec/index.js\";\nexport { FormatValidatorBasic } from \"./external-utilities/index.js\";\n\nexport type {\n\t// Type Testing\n\trequireTrue,\n\trequireFalse,\n\trequireAssignableTo,\n\tareSafelyAssignable,\n\tisAssignableTo,\n\tisAny,\n\teitherIsAny,\n\t// Other\n\tRestrictiveReadonlyRecord,\n\tRestrictiveStringRecord,\n\tMakeNominal,\n\tIsUnion,\n\tUnionToIntersection,\n\tUnionToTuple,\n\tPopUnion,\n\tJsonCompatible,\n\tJsonCompatibleObject,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnlyObject,\n} from \"./util/index.js\";\nexport { cloneWithReplacements } from \"./util/index.js\";\n\nimport * as InternalTypes from \"./internalTypes.js\";\n/**\n * Contains types used by the API, but which serve mechanical purposes and do not represent semantic concepts.\n * They are used internally to implement API aspects, but are not intended for use by external consumers.\n */\n// eslint-disable-next-line unicorn/prefer-export-from -- fixing requires `export * as` (breaks API-Extractor)\nexport { InternalTypes };\n\n// Internal/System types:\n// These would be put in `internalTypes` except doing so tents to cause errors like:\n// The inferred type of 'NodeMap' cannot be named without a reference to '../../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.\nexport type { MapNodeInsertableData } from \"./simple-tree/index.js\";\n\nexport { JsonAsTree } from \"./jsonDomainSchema.js\";\nexport { FluidSerializableAsTree } from \"./serializableDomainSchema.js\";\nexport { TableSchema, type System_TableSchema } from \"./tableSchema.js\";\nexport { asAlpha, asBeta } from \"./api.js\";\n\nexport { TextAsTree, FormattedTextAsTree } from \"./text/index.js\";\nexport { ExtensibleUnionNode } from \"./extensibleUnionNode.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+FAA+F;AAC/F,yDAAyD;AAEzD,4CAcyB;AAbxB,uGAAA,WAAW,OAAA;AAEX,sGAAA,UAAU,OAAA;AACV,4GAAA,gBAAgB,OAAA;AA4CjB,yDAMsC;AALrC,sGAAA,UAAU,OAAA;AACV,mHAAA,uBAAuB,OAAA;AAMxB,mDAsBgC;AAhB/B,gGAAA,IAAI,OAAA;AAGJ,sHAAA,0BAA0B,OAAA;AAE1B,qGAAA,SAAS,OAAA;AAGT,2GAAA,eAAe,OAAA;AAEf,qHAAA,yBAAyB,OAAA;AACzB,sHAAA,0BAA0B,OAAA;AAE1B,+GAAA,mBAAmB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AACjC,6HAAA,iCAAiC,OAAA;AACjC,6HAAA,iCAAiC,OAAA;AACjC,6HAAA,iCAAiC,OAAA;AACjC,8GAAA,kBAAkB,OAAA;AAClB,uHAAA,2BAA2B,OAAA;AAE3B,kHAAA,sBAAsB,OAAA;AACtB,oIAAA,wCAAwC,OAAA;AACxC,8GAAA,kBAAkB,OAAA;AAClB,0HAAA,8BAA8B,OAAA;AAM9B,sHAAA,0BAA0B,OAAA;AAI3B,mDAM0B;AALzB,4GAAA,UAAU,OAAA;AACV,sHAAA,oBAAoB,OAAA;AACpB,2HAAA,yBAAyB,OAAA;AACzB,0HAAA,wBAAwB,OAAA;AACxB,gIAAA,8BAA8B,OAAA;AAE/B,qEAAwF;AAA/E,+HAAA,oBAAoB,OAAA;AAAE,gIAAA,qBAAqB,OAAA;AACpD,mDAAiE;AAAxD,mHAAA,uBAAuB,OAAA;AAEhC,6CAS0B;AALzB,8GAAA,kBAAkB,OAAA;AAElB,+GAAA,mBAAmB,OAAA;AAIpB,0DAAqE;AAA5D,gHAAA,oBAAoB,OAAA;AAwB7B,4CAAwD;AAA/C,iHAAA,qBAAqB,OAAA;AAE9B,kEAAoD;AAY3C,sCAAa;AAOtB,6DAAmD;AAA1C,iHAAA,UAAU,OAAA;AACnB,6EAAwE;AAA/D,sIAAA,uBAAuB,OAAA;AAChC,mDAAwE;AAA/D,6GAAA,WAAW,OAAA;AACpB,mCAA2C;AAAlC,iGAAA,OAAO,OAAA;AAAE,gGAAA,MAAM,OAAA;AAExB,4CAAkE;AAAzD,sGAAA,UAAU,OAAA;AAAE,+GAAA,mBAAmB,OAAA;AACxC,mEAA+D;AAAtD,6HAAA,mBAAmB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// For the time being, if exports are changed, additional files under entrypoints need updated.\n// Run `pnpm generate:entrypoint-sources` to update them.\n\nexport {\n\tValueSchema,\n\ttype Revertible,\n\tCommitKind,\n\tRevertibleStatus,\n\ttype CommitMetadata,\n\ttype LocalChangeMetadata,\n\ttype RemoteChangeMetadata,\n\ttype ChangeMetadata,\n\ttype LabelTree,\n\ttype TransactionLabels,\n\ttype RevertibleFactory,\n\ttype RevertibleAlphaFactory,\n\ttype RevertibleAlpha,\n} from \"./core/index.js\";\n\nimport type {\n\tListeners as EventListeners,\n\tIsListener as EventIsListener,\n\tListenable as EventListenable,\n\tOff as EventOff,\n} from \"@fluidframework/core-interfaces\";\n\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Listeners}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Listeners<T extends object> = EventListeners<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#IsListener}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type IsListener<T> = EventIsListener<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Listenable}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Listenable<T extends object> = EventListenable<T>;\n/**\n * {@inheritdoc @fluidframework/core-interfaces#Off}\n * @public\n * @deprecated Deprecated in `@fluidframework/tree`. Consider importing from `fluid-framework` or `@fluidframework/core-interfaces` instead.\n */\nexport type Off = EventOff;\n\nexport {\n\tTreeStatus,\n\tTreeCompressionStrategy,\n\ttype TreeIndex,\n\ttype TreeIndexNodes,\n\ttype IncrementalEncodingPolicy,\n} from \"./feature-libraries/index.js\";\n\nexport {\n\ttype ITreeInternal,\n\ttype SharedTreeOptions,\n\ttype SharedTreeOptionsBeta,\n\ttype ForestType,\n\ttype SharedTreeFormatOptions,\n\tTree,\n\ttype RunTransaction,\n\ttype ForestOptions,\n\tindependentInitializedView,\n\ttype ViewContent,\n\tTreeAlpha,\n\ttype ObservationResults,\n\ttype TreeIdentifierUtils,\n\tindependentView,\n\ttype IndependentViewOptions,\n\tcreateIndependentTreeBeta,\n\tcreateIndependentTreeAlpha,\n\ttype CreateIndependentTreeAlphaOptions,\n\tForestTypeOptimized,\n\tForestTypeExpensiveDebug,\n\tForestTypeReference,\n} from \"./shared-tree/index.js\";\n\nexport {\n\tTreeArrayNode,\n\ttype TreeArrayNodeAlpha,\n\ttype Unhydrated,\n\tIterableTreeArrayContent,\n\tTreeNode,\n\ttype ViewableTree,\n\ttype ITree,\n\ttype TreeNodeSchema,\n\tTreeViewConfiguration,\n\ttype ITreeViewConfiguration,\n\ttype ITreeConfigurationOptions,\n\ttype TreeView,\n\ttype TreeViewEvents,\n\tSchemaFactory,\n\tSchemaFactoryBeta,\n\ttype SchemaStaticsBeta,\n\tSchemaFactoryAlpha,\n\ttype ObjectSchemaOptionsAlpha,\n\ttype ObjectSchemaOptions,\n\ttype ImplicitFieldSchema,\n\ttype TreeFieldFromImplicitField,\n\ttype TreeChangeEvents,\n\ttype NodeFromSchema,\n\ttype TreeMapNode,\n\ttype InsertableTreeNodeFromImplicitAllowedTypes,\n\ttype TreeLeafValue,\n\tFieldKind,\n\tFieldSchema,\n\ttype FieldSchemaAlpha,\n\ttype FieldSchemaMetadata,\n\ttype ImplicitAllowedTypes,\n\ttype InsertableTreeFieldFromImplicitField,\n\ttype InsertableTypedNode,\n\tNodeKind,\n\ttype TreeObjectNode,\n\tObjectNodeSchema,\n\ttype ObjectNodeSchemaWorkaround,\n\ttype TreeNodeFromImplicitAllowedTypes,\n\ttype TreeNodeSchemaClass,\n\ttype SchemaCompatibilityStatus,\n\ttype FieldProps,\n\ttype FieldPropsAlpha,\n\tnormalizeFieldSchema,\n\ttype InternalTreeNode,\n\ttype WithType,\n\ttype ArrayNodeDeltaOp,\n\ttype ArrayNodeInsertOp,\n\ttype ArrayNodeRemoveOp,\n\ttype ArrayNodeRetainOp,\n\ttype NodeChangedData,\n\ttype NodeChangedDataAlpha,\n\ttype NodeChangedDataDelta,\n\ttype NodeChangedDataProperties,\n\ttype SchemaUpgrade,\n\tcontentSchemaSymbol,\n\t// Types not really intended for public use, but used in links.\n\t// Can not be moved to internalTypes since doing so causes app code to throw errors like:\n\t// Error: src/simple-tree/objectNode.ts:72:1 - (ae-unresolved-link) The @link reference could not be resolved: The package \"@fluidframework/tree\" does not have an export \"TreeNodeApi\"\n\ttype TreeNodeApi,\n\ttype TreeNodeSchemaCore,\n\t// Types not really intended for public use, but used in inferred types exposed in the public API.\n\t// Can not be moved to internalTypes since doing so causes app code to throw errors like:\n\t// error TS2742: The inferred type of 'Inventory' cannot be named without a reference to '../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.\n\ttype AllowedTypes,\n\ttype System_Unsafe,\n\ttype FieldSchemaAlphaUnsafe,\n\ttype FieldHasDefaultAlphaUnsafe,\n\ttype InsertableObjectFromSchemaRecordAlphaUnsafe,\n\ttype ArrayNodeCustomizableSchemaUnsafe,\n\ttype MapNodeCustomizableSchemaUnsafe,\n\ttype TreeRecordNodeUnsafe,\n\ttype UnannotateAllowedTypeUnsafe,\n\ttype AnnotatedAllowedTypeUnsafe,\n\ttype AnnotatedAllowedTypesUnsafe,\n\ttype AllowedTypesFullUnsafe,\n\ttype AllowedTypesFullFromMixedUnsafe,\n\ttype UnannotateAllowedTypesListUnsafe,\n\ttype AnnotateAllowedTypesListUnsafe,\n\t// System types (not in Internal types for various reasons, like doc links or cannot be named errors).\n\ttype typeSchemaSymbol,\n\ttype TreeNodeSchemaNonClass,\n\t// Recursive Schema APIs\n\ttype ValidateRecursiveSchema,\n\ttype FixRecursiveArraySchema,\n\t// Index APIs\n\ttype IdentifierIndex,\n\tcreateTreeIndex,\n\tcreateIdentifierIndex,\n\ttype DirtyTreeStatus,\n\ttrackDirtyNodes,\n\ttype DirtyTreeMap,\n\ttype TreeIndexKey,\n\t// experimental @alpha APIs:\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n\ttype UnsafeUnknownSchema,\n\ttype TreeViewAlpha,\n\ttype TreeViewBeta,\n\ttype InsertableField,\n\ttype Insertable,\n\ttype InsertableContent,\n\ttype FactoryContent,\n\ttype FactoryContentObject,\n\ttype ReadableField,\n\ttype ReadSchema,\n\ttype AnnotatedAllowedType,\n\ttype AnnotatedAllowedTypes,\n\ttype AllowedTypesFullEvaluated,\n\ttype AllowedTypeMetadata,\n\ttype AllowedTypesMetadata,\n\ttype UnannotateAllowedTypesList,\n\ttype AnnotateAllowedTypesList,\n\ttype AllowedTypesFull,\n\ttype AllowedTypesFullFromMixed,\n\ttype SchemaType,\n\ttype SchemaStaticsAlpha,\n\ttype NodeProvider,\n\ttype InsertableObjectFromSchemaRecordAlpha,\n\ttype FieldHasDefaultAlpha,\n\t// Beta APIs\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n\ttype TreeChangeEventsAlpha,\n\t// Other\n\ttype VerboseTreeNode,\n\ttype TreeEncodingOptions,\n\ttype TreeSchemaEncodingOptions,\n\ttype TreeSchema,\n\tTreeViewConfigurationAlpha,\n\ttype VerboseTree,\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n\ttype ConciseTree,\n\t// Back to normal types\n\ttype JsonTreeSchema,\n\ttype JsonSchemaId,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonLeafNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonObjectNodeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonSchemaType,\n\ttype JsonLeafSchemaType,\n\ttype JsonRecordNodeSchema,\n\ttype JsonStringKeyPatternProperties,\n\tgetJsonSchema,\n\ttype LazyItem,\n\ttype Unenforced,\n\ttype SimpleNodeSchemaBase,\n\ttype SimpleNodeSchemaBaseAlpha,\n\ttype SimpleTreeSchema,\n\ttype SimpleNodeSchema,\n\ttype SimpleFieldSchema,\n\ttype SimpleLeafNodeSchema,\n\ttype SimpleMapNodeSchema,\n\ttype SimpleArrayNodeSchema,\n\ttype SimpleObjectNodeSchema,\n\ttype SimpleObjectFieldSchema,\n\ttype SimpleRecordNodeSchema,\n\tnormalizeAllowedTypes,\n\twalkFieldSchema,\n\twalkNodeSchema,\n\twalkAllowedTypes,\n\ttype SchemaVisitor,\n\tgetSimpleSchema,\n\ttype ReadonlyArrayNode,\n\ttype InsertableTreeNodeFromAllowedTypes,\n\ttype Input,\n\ttype TreeBranch,\n\ttype TreeBranchAlpha,\n\ttype TreeBranchEvents,\n\tasTreeViewAlpha,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaOptionsAlpha,\n\ttype NodeSchemaMetadata,\n\ttype SchemaStatics,\n\ttype ITreeAlpha,\n\ttype TransactionConstraint,\n\ttype TransactionConstraintAlpha,\n\ttype NodeInDocumentConstraint,\n\ttype NoChangeConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n\tgenerateSchemaFromSimpleSchema,\n\tevaluateLazySchema,\n\treplaceConciseTreeHandles,\n\treplaceHandles,\n\treplaceVerboseTreeHandles,\n\ttype HandleConverter,\n\tallowUnused,\n\ttype LeafSchema,\n\ttype ArrayNodeCustomizableSchema,\n\ttype ArrayNodeCustomizableSchemaAlpha,\n\ttype ArrayNodePojoEmulationSchema,\n\tArrayNodeSchema,\n\ttype MapNodeCustomizableSchema,\n\ttype MapNodePojoEmulationSchema,\n\tMapNodeSchema,\n\ttype ObjectFromSchemaRecord,\n\ttype ValidateRecursiveSchemaTemplate,\n\ttype FixRecursiveRecursionLimit,\n\tRecordNodeSchema,\n\ttype RecordNodeCustomizableSchema,\n\ttype RecordNodeInsertableData,\n\ttype RecordNodePojoEmulationSchema,\n\ttype TreeRecordNode,\n\tKeyEncodingOptions,\n\ttype TreeParsingOptions,\n\ttype SchemaFactory_base,\n\ttype NumberKeys,\n\ttype SimpleAllowedTypeAttributes,\n\tencodeSchemaCompatibilitySnapshot,\n\tdecodeSchemaCompatibilitySnapshot,\n\texportCompatibilitySchemaSnapshot,\n\timportCompatibilitySchemaSnapshot,\n\tcheckCompatibility,\n\tsnapshotSchemaCompatibility,\n\ttype SnapshotFileSystem,\n\tincrementalSummaryHint,\n\tincrementalEncodingPolicyForAllowedTypes,\n\teraseSchemaDetails,\n\teraseSchemaDetailsSubclassable,\n\ttype ErasedSchema,\n\ttype ErasedNode,\n\ttype ErasedSchemaSubclassable,\n\ttype SnapshotSchemaCompatibilityOptions,\n\ttype ArrayPlaceAnchor,\n\tcreateArrayInsertionAnchor,\n\ttype WithValue,\n\ttype TreeContextAlpha,\n} from \"./simple-tree/index.js\";\nexport {\n\tSharedTree,\n\tconfiguredSharedTree,\n\tconfiguredSharedTreeAlpha,\n\tconfiguredSharedTreeBeta,\n\tconfiguredSharedTreeBetaLegacy,\n} from \"./treeFactory.js\";\nexport { SharedTreeAttributes, SharedTreeFactoryType } from \"./sharedTreeAttributes.js\";\nexport { persistedToSimpleSchema } from \"./shared-tree/index.js\";\n\nexport {\n\ttype ICodecOptions,\n\ttype CodecWriteOptions,\n\ttype CodecWriteOptionsBeta,\n\tFluidClientVersion,\n\ttype FormatValidator,\n\tFormatValidatorNoOp,\n\ttype CodecName,\n\ttype FormatVersion,\n} from \"./codec/index.js\";\nexport { FormatValidatorBasic } from \"./external-utilities/index.js\";\n\nexport type {\n\t// Type Testing\n\trequireTrue,\n\trequireFalse,\n\trequireAssignableTo,\n\tareSafelyAssignable,\n\tisAssignableTo,\n\tisAny,\n\teitherIsAny,\n\t// Other\n\tRestrictiveReadonlyRecord,\n\tRestrictiveStringRecord,\n\tMakeNominal,\n\tIsUnion,\n\tUnionToIntersection,\n\tUnionToTuple,\n\tPopUnion,\n\tJsonCompatible,\n\tJsonCompatibleObject,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnlyObject,\n} from \"./util/index.js\";\nexport { cloneWithReplacements } from \"./util/index.js\";\n\nimport * as InternalTypes from \"./internalTypes.js\";\n/**\n * Contains types used by the API, but which serve mechanical purposes and do not represent semantic concepts.\n * They are used internally to implement API aspects, but are not intended for use by external consumers.\n *\n * @public\n * @system\n *\n * @privateRemarks These TS-Docs are not recognized by API-Extractor, but the\n * support level tag is recognized by flub entrypoint generation.\n */\n// eslint-disable-next-line unicorn/prefer-export-from -- fixing requires `export * as` (breaks API-Extractor)\nexport { InternalTypes };\n\n// Internal/System types:\n// These would be put in `internalTypes` except doing so tents to cause errors like:\n// The inferred type of 'NodeMap' cannot be named without a reference to '../../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.\nexport type { MapNodeInsertableData } from \"./simple-tree/index.js\";\n\nexport { JsonAsTree } from \"./jsonDomainSchema.js\";\nexport { FluidSerializableAsTree } from \"./serializableDomainSchema.js\";\nexport { TableSchema, type System_TableSchema } from \"./tableSchema.js\";\nexport { asAlpha, asBeta } from \"./api.js\";\n\nexport { TextAsTree, FormattedTextAsTree } from \"./text/index.js\";\nexport { ExtensibleUnionNode } from \"./extensibleUnionNode.js\";\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/tree";
8
- export declare const pkgVersion = "2.90.0";
8
+ export declare const pkgVersion = "2.92.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/tree";
11
- exports.pkgVersion = "2.90.0";
11
+ exports.pkgVersion = "2.92.0";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,sBAAsB,CAAC;AACjC,QAAA,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/tree\";\nexport const pkgVersion = \"2.90.0\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,sBAAsB,CAAC;AACjC,QAAA,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/tree\";\nexport const pkgVersion = \"2.92.0\";\n"]}
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import type { IFluidHandle } from "@fluidframework/core-interfaces";
6
6
  import { type IIdCompressor } from "@fluidframework/id-compressor/internal";
7
- import { type CodecWriteOptions, type ICodecOptions } from "../codec/index.js";
7
+ import type { CodecWriteOptions, ICodecOptions } from "../codec/index.js";
8
8
  import type { TreeViewConfiguration, ImplicitFieldSchema, TreeViewAlpha, ITreeAlpha, ViewableTree } from "../simple-tree/index.js";
9
9
  import { type JsonCompatible } from "../util/index.js";
10
10
  import { type ForestOptions } from "./sharedTree.js";
@@ -1 +1 @@
1
- {"version":3,"file":"independentView.d.ts","sourceRoot":"","sources":["../../src/shared-tree/independentView.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,EACN,KAAK,aAAa,EAElB,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAEN,KAAK,iB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,CAAC;CACrC"}
@@ -7,11 +7,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.createIndependentTreeAlpha = exports.createIndependentTreeBeta = exports.independentInitializedView = exports.independentView = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const internal_2 = require("@fluidframework/id-compressor/internal");
10
- const index_js_1 = require("../codec/index.js");
11
- const index_js_2 = require("../core/index.js");
10
+ const index_js_1 = require("../core/index.js");
11
+ const index_js_2 = require("../feature-libraries/index.js");
12
12
  const index_js_3 = require("../feature-libraries/index.js");
13
- const index_js_4 = require("../feature-libraries/index.js");
14
- const index_js_5 = require("../util/index.js");
13
+ const index_js_4 = require("../util/index.js");
15
14
  const schematizeTree_js_1 = require("./schematizeTree.js");
16
15
  const schematizingTreeView_js_1 = require("./schematizingTreeView.js");
17
16
  const sharedTree_js_1 = require("./sharedTree.js");
@@ -114,13 +113,13 @@ exports.createIndependentTreeBeta = createIndependentTreeBeta;
114
113
  * @alpha
115
114
  */
116
115
  function createIndependentTreeAlpha(options) {
117
- const breaker = new index_js_5.Breakable("independentView");
116
+ const breaker = new index_js_4.Breakable("independentView");
118
117
  const idCompressor = options?.idCompressor ?? options?.content?.idCompressor ?? (0, internal_2.createIdCompressor)();
119
118
  const mintRevisionTag = () => idCompressor.generateCompressedId();
120
- const revisionTagCodec = new index_js_2.RevisionTagCodec(idCompressor);
119
+ const revisionTagCodec = new index_js_1.RevisionTagCodec(idCompressor);
121
120
  // To ensure the forest is in schema when constructed, start it with an empty schema and set the schema repository content later.
122
- const schemaRepository = new index_js_2.TreeStoredSchemaRepository();
123
- const forest = (0, sharedTree_js_1.buildConfiguredForest)(breaker, options?.forest ?? sharedTree_js_1.defaultSharedTreeOptions.forest, schemaRepository, idCompressor, index_js_3.defaultIncrementalEncodingPolicy);
121
+ const schemaRepository = new index_js_1.TreeStoredSchemaRepository();
122
+ const forest = (0, sharedTree_js_1.buildConfiguredForest)(breaker, options?.forest ?? sharedTree_js_1.defaultSharedTreeOptions.forest, schemaRepository, idCompressor, index_js_2.defaultIncrementalEncodingPolicy);
124
123
  const checkout = (0, treeCheckout_js_1.createTreeCheckout)(idCompressor, mintRevisionTag, revisionTagCodec, {
125
124
  forest,
126
125
  schema: schemaRepository,
@@ -128,30 +127,24 @@ function createIndependentTreeAlpha(options) {
128
127
  codecOptions: options,
129
128
  });
130
129
  if (options?.content !== undefined) {
131
- // Any version can be passed down to `makeSchemaCodec` and `fieldBatchCodecBuilder.build` here.
132
- // We only use the decode part, which always dispatches to the correct codec based on the version in the data, not `minVersionForCollab`.
133
- const writeOptions = {
134
- ...options,
135
- minVersionForCollab: index_js_1.FluidClientVersion.v2_0,
136
- };
137
- const schemaCodec = (0, index_js_3.makeSchemaCodec)(writeOptions, index_js_2.SchemaFormatVersion.v1);
138
- const fieldBatchCodec = index_js_3.fieldBatchCodecBuilder.build(writeOptions);
130
+ const schemaCodec = index_js_2.schemaCodecBuilder.buildDecoder(options);
131
+ const fieldBatchCodec = index_js_2.fieldBatchCodecBuilder.buildDecoder(options);
139
132
  const newSchema = schemaCodec.decode(options.content.schema);
140
133
  const context = {
141
- encodeType: index_js_3.TreeCompressionStrategy.Compressed,
134
+ encodeType: index_js_2.TreeCompressionStrategy.Compressed,
142
135
  idCompressor,
143
136
  originatorId: idCompressor.localSessionId, // Is this right? If so, why is is needed?
144
- schema: { schema: newSchema, policy: index_js_3.defaultSchemaPolicy },
137
+ schema: { schema: newSchema, policy: index_js_2.defaultSchemaPolicy },
145
138
  };
146
139
  const fieldCursors = fieldBatchCodec.decode(options.content.tree, context);
147
140
  (0, internal_1.assert)(fieldCursors.length === 1, 0xa5b /* must have exactly 1 field in batch */);
148
- const fieldCursor = (0, index_js_5.oneFromIterable)(fieldCursors);
141
+ const fieldCursor = (0, index_js_4.oneFromIterable)(fieldCursors);
149
142
  (0, internal_1.assert)(fieldCursor !== undefined, 0xc94 /* expected exactly one field in batch */);
150
- (0, schematizeTree_js_1.initialize)(checkout, newSchema, (0, schematizeTree_js_1.initializerFromChunk)(checkout, () => (0, index_js_4.combineChunks)(checkout.forest.chunkField(fieldCursor))));
143
+ (0, schematizeTree_js_1.initialize)(checkout, newSchema, (0, schematizeTree_js_1.initializerFromChunk)(checkout, () => (0, index_js_3.combineChunks)(checkout.forest.chunkField(fieldCursor))));
151
144
  }
152
145
  return {
153
146
  viewWith(config) {
154
- const out = new schematizingTreeView_js_1.SchematizingSimpleTreeView(checkout, config, (0, index_js_3.createNodeIdentifierManager)(idCompressor));
147
+ const out = new schematizingTreeView_js_1.SchematizingSimpleTreeView(checkout, config, (0, index_js_2.createNodeIdentifierManager)(idCompressor));
155
148
  return out;
156
149
  },
157
150
  exportVerbose() {
@@ -1 +1 @@
1
- {"version":3,"file":"independentView.js","sourceRoot":"","sources":["../../src/shared-tree/independentView.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kEAA6D;AAC7D,qEAGgD;AAEhD,gDAI2B;AAC3B,+CAK0B;AAC1B,4DAQuC;AACvC,4DAA8D;AAc9D,+CAK0B;AAE1B,2DAAuE;AACvE,uEAAuE;AACvE,mDAKyB;AACzB,uDAAuD;AAyCvD;;;;;;;;GAQG;AACH,SAAgB,eAAe,CAC9B,MAAsC,EACtC,OAAgC;IAEhC,OAAO,0BAA0B,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,MAAM,CAA2B,CAAC;AACvF,CAAC;AALD,0CAKC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,0BAA0B,CACzC,MAAsC,EACtC,OAAsC,EACtC,OAAoB;IAEpB,OAAO,0BAA0B,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,QAAQ,CAClE,MAAM,CACoB,CAAC;AAC7B,CAAC;AARD,gEAQC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,SAAgB,yBAAyB,CACxC,OAAuB;IAEvB,OAAO,0BAA0B,CAAU,OAAO,CA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,CAAC;QAEvE,MAAM,OAAO,GAA8B;YAC1C,UAAU,EAAE,kCAAuB,CAAC,UAAU;YAC9C,YAAY;YACZ,YAAY,EAAE,YAAY,CAAC,cAAc,EAAE,0CAA0C;YACrF,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,8BAAmB,EAAE;SAC1D,CAAC;QACF,MAAM,YAAY,GAAG,eAAe,CAAC,MAAM,CAC1C,OAAO,CAAC,OAAO,CAAC,IAA8B,EAC9C,OAAO,CACP,CAAC;QACF,IAAA,iBAAM,EAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAElF,MAAM,WAAW,GAAG,IAAA,0BAAe,EAAC,YAAY,CAAC,CAAC;QAClD,IAAA,iBAAM,EAAC,WAAW,KAAK,SAAS,EAAE,KAAK,CAAC,yCAAyC,CAAC,CAAC;QAEnF,IAAA,8BAAU,EACT,QAAQ,EACR,SAAS,EACT,IAAA,wCAAoB,EAAC,QAAQ,EAAE,GAAG,EAAE,CACnC,IAAA,wBAAa,EAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CACtD,CACD,CAAC;IACH,CAAC;IAED,OAAO;QACN,QAAQ,CACP,MAAoC;YAEpC,MAAM,GAAG,GAA2B,IAAI,oDAA0B,CACjE,QAAQ,EACR,MAA6E,EAC7E,IAAA,sCAA2B,EAAC,YAAY,CAAC,CACzC,CAAC;YACF,OAAO,GAAiC,CAAC;QAC1C,CAAC;QAED,aAAa;YACZ,OAAO,QAAQ,CAAC,aAAa,EAAE,CAAC;QACjC,CAAC;QAED,kBAAkB;YACjB,OAAO,IAAA,kCAAkB,EAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;QAClD,CAAC;KACD,CAAC;AACH,CAAC;AAlFD,gEAkFC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\ttype IIdCompressor,\n\tcreateIdCompressor,\n} from \"@fluidframework/id-compressor/internal\";\n\nimport {\n\tFluidClientVersion,\n\ttype CodecWriteOptions,\n\ttype ICodecOptions,\n} from \"../codec/index.js\";\nimport {\n\ttype RevisionTag,\n\tRevisionTagCodec,\n\tSchemaFormatVersion,\n\tTreeStoredSchemaRepository,\n} from \"../core/index.js\";\nimport {\n\tcreateNodeIdentifierManager,\n\tfieldBatchCodecBuilder,\n\tmakeSchemaCodec,\n\ttype FieldBatchEncodingContext,\n\tdefaultSchemaPolicy,\n\tTreeCompressionStrategy,\n\tdefaultIncrementalEncodingPolicy,\n} from \"../feature-libraries/index.js\";\nimport { combineChunks } from \"../feature-libraries/index.js\";\n// eslint-disable-next-line import-x/no-internal-modules\nimport type { Format } from \"../feature-libraries/schema-index/formatV1.js\";\nimport type {\n\tTreeViewConfiguration,\n\tImplicitFieldSchema,\n\tTreeViewAlpha,\n\tITreeAlpha,\n\tViewableTree,\n\tTreeView,\n\tReadSchema,\n\tVerboseTree,\n\tSimpleTreeSchema,\n} from \"../simple-tree/index.js\";\nimport {\n\ttype JsonCompatibleReadOnly,\n\ttype JsonCompatible,\n\tBreakable,\n\toneFromIterable,\n} from \"../util/index.js\";\n\nimport { initialize, initializerFromChunk } from \"./schematizeTree.js\";\nimport { SchematizingSimpleTreeView } from \"./schematizingTreeView.js\";\nimport {\n\tbuildConfiguredForest,\n\tdefaultSharedTreeOptions,\n\texportSimpleSchema,\n\ttype ForestOptions,\n} from \"./sharedTree.js\";\nimport { createTreeCheckout } from \"./treeCheckout.js\";\n\n/**\n * {@link independentView} options.\n * @alpha @input\n */\nexport interface IndependentViewOptions extends ForestOptions, Partial<CodecWriteOptions> {\n\t/**\n\t * Optional ID compressor for generating and compressing identifiers.\n\t * If not provided, a new one will be created.\n\t */\n\tidCompressor?: IIdCompressor | undefined;\n}\n\n/**\n * {@link createIndependentTreeAlpha} options.\n * @alpha\n */\nexport type CreateIndependentTreeAlphaOptions = ForestOptions &\n\t(\n\t\t| (IndependentViewOptions & {\n\t\t\t\t/**\n\t\t\t\t * Optional content for initializing the tree.\n\t\t\t\t * If not provided, the tree will be uninitialized.\n\t\t\t\t */\n\t\t\t\tcontent?: never;\n\t\t })\n\t\t| (ICodecOptions & {\n\t\t\t\t/**\n\t\t\t\t * Content for initializing the tree.\n\t\t\t\t * The content includes the idCompressor, so idCompressor should not be provided at the top level.\n\t\t\t\t */\n\t\t\t\tcontent: ViewContent;\n\t\t\t\t/**\n\t\t\t\t * Should not be provided when content is specified.\n\t\t\t\t * The idCompressor will be obtained from the content.\n\t\t\t\t */\n\t\t\t\tidCompressor?: never;\n\t\t })\n\t);\n\n/**\n * Create an uninitialized {@link TreeView} that is not tied to any {@link ITree} instance.\n *\n * @remarks\n * Such a view can never experience collaboration or be persisted to to a Fluid Container.\n *\n * This can be useful for testing, as well as use-cases like working on local files instead of documents stored in some Fluid service.\n * @alpha\n */\nexport function independentView<const TSchema extends ImplicitFieldSchema>(\n\tconfig: TreeViewConfiguration<TSchema>,\n\toptions?: IndependentViewOptions,\n): TreeViewAlpha<TSchema> {\n\treturn createIndependentTreeAlpha(options).viewWith(config) as TreeViewAlpha<TSchema>;\n}\n\n/**\n * Create an initialized {@link TreeView} that is not tied to any {@link ITree} instance.\n *\n * @remarks\n * Such a view can never experience collaboration or be persisted to to a Fluid Container.\n *\n * This can be useful for testing, as well as use-cases like working on local files instead of documents stored in some Fluid service.\n * @privateRemarks\n * TODO: Providing an API which generates a {@link ViewableTree} extended with export options from {@link ITreeAlpha} and maybe even branching APIs would likely be better that just exposing a {@link TreeViewAlpha}.\n * @alpha\n */\nexport function independentInitializedView<const TSchema extends ImplicitFieldSchema>(\n\tconfig: TreeViewConfiguration<TSchema>,\n\toptions: ForestOptions & ICodecOptions,\n\tcontent: ViewContent,\n): TreeViewAlpha<TSchema> {\n\treturn createIndependentTreeAlpha({ ...options, content }).viewWith(\n\t\tconfig,\n\t) as TreeViewAlpha<TSchema>;\n}\n\n/**\n * Create a {@link ViewableTree} that is not tied to any Fluid runtimes or services.\n *\n * @remarks\n * Such a tree can never experience collaboration or be persisted to to a Fluid Container.\n *\n * This can be useful for testing, as well as use-cases like working on local files instead of documents stored in some Fluid service.\n *\n * @example\n * ```typescript\n * const tree = createIndependentTreeBeta();\n *\n * const stagedConfig = new TreeViewConfiguration({\n * \tschema: SchemaFactoryAlpha.types([\n * \t\tSchemaFactory.number,\n * \t\tSchemaFactoryAlpha.staged(SchemaFactory.string),\n * \t]),\n * });\n * const afterConfig = new TreeViewConfigurationAlpha({\n * \tschema: [SchemaFactory.number, SchemaFactory.string],\n * });\n *\n * // Initialize tree\n * {\n * \tconst view = tree.viewWith(stagedConfig);\n * \tview.initialize(1);\n * \tview.dispose();\n * }\n *\n * // Do schema upgrade\n * {\n * \tconst view = tree.viewWith(afterConfig);\n * \tview.upgradeSchema();\n * \tview.root = \"A\";\n * \tview.dispose();\n * }\n *\n * // Can still view tree with staged schema\n * {\n * \tconst view = tree.viewWith(stagedConfig);\n * \tassert.equal(view.root, \"A\");\n * \tview.dispose();\n * }\n * ```\n * @privateRemarks\n * Before stabilizing this as public, consider if we can instead just expose a better way to create regular Fluid service based SharedTrees for tests.\n * Something like https://github.com/microsoft/FluidFramework/pull/25422 might be a better long term stable/public solution.\n * @beta\n */\nexport function createIndependentTreeBeta<const TSchema extends ImplicitFieldSchema>(\n\toptions?: ForestOptions,\n): ViewableTree {\n\treturn createIndependentTreeAlpha<TSchema>(options);\n}\n\n/**\n * Alpha extensions to {@link createIndependentTreeBeta}.\n *\n * @param options - Configuration options for the independent tree.\n * This can be used to create an uninitialized tree, or `content` can be provided to create an initialized tree.\n * If content is provided, the idCompressor is a required part of it: otherwise it is optional and provided at the top level.\n *\n * @privateRemarks\n * TODO: Support more of {@link ITreeAlpha}, including branching APIs to allow for merges.\n * TODO: Better unify this logic with SharedTreeKernel and SharedTreeCore.\n *\n * Before further stabilizing: consider better ways to handle initialized vs uninitialized trees.\n * Perhaps it would be better to not allow initialize here at all, but expose the ability to load compressed tree content and stored schema via ITree or TreeView?\n * If keeping the option here, maybe a separate function of overload would be better? Or maybe flatten ViewContent inline to deduplicate the idCompressor options?\n * @alpha\n */\nexport function createIndependentTreeAlpha<const TSchema extends ImplicitFieldSchema>(\n\toptions?: CreateIndependentTreeAlphaOptions,\n): ViewableTree & Pick<ITreeAlpha, \"exportVerbose\" | \"exportSimpleSchema\"> {\n\tconst breaker = new Breakable(\"independentView\");\n\tconst idCompressor: IIdCompressor =\n\t\toptions?.idCompressor ?? options?.content?.idCompressor ?? createIdCompressor();\n\tconst mintRevisionTag = (): RevisionTag => idCompressor.generateCompressedId();\n\tconst revisionTagCodec = new RevisionTagCodec(idCompressor);\n\n\t// To ensure the forest is in schema when constructed, start it with an empty schema and set the schema repository content later.\n\tconst schemaRepository = new TreeStoredSchemaRepository();\n\n\tconst forest = buildConfiguredForest(\n\t\tbreaker,\n\t\toptions?.forest ?? defaultSharedTreeOptions.forest,\n\t\tschemaRepository,\n\t\tidCompressor,\n\t\tdefaultIncrementalEncodingPolicy,\n\t);\n\n\tconst checkout = createTreeCheckout(idCompressor, mintRevisionTag, revisionTagCodec, {\n\t\tforest,\n\t\tschema: schemaRepository,\n\t\tbreaker,\n\t\tcodecOptions: options,\n\t});\n\n\tif (options?.content !== undefined) {\n\t\t// Any version can be passed down to `makeSchemaCodec` and `fieldBatchCodecBuilder.build` here.\n\t\t// We only use the decode part, which always dispatches to the correct codec based on the version in the data, not `minVersionForCollab`.\n\t\tconst writeOptions: CodecWriteOptions = {\n\t\t\t...options,\n\t\t\tminVersionForCollab: FluidClientVersion.v2_0,\n\t\t};\n\t\tconst schemaCodec = makeSchemaCodec(writeOptions, SchemaFormatVersion.v1);\n\t\tconst fieldBatchCodec = fieldBatchCodecBuilder.build(writeOptions);\n\t\tconst newSchema = schemaCodec.decode(options.content.schema as Format);\n\n\t\tconst context: FieldBatchEncodingContext = {\n\t\t\tencodeType: TreeCompressionStrategy.Compressed,\n\t\t\tidCompressor,\n\t\t\toriginatorId: idCompressor.localSessionId, // Is this right? If so, why is is needed?\n\t\t\tschema: { schema: newSchema, policy: defaultSchemaPolicy },\n\t\t};\n\t\tconst fieldCursors = fieldBatchCodec.decode(\n\t\t\toptions.content.tree as JsonCompatibleReadOnly,\n\t\t\tcontext,\n\t\t);\n\t\tassert(fieldCursors.length === 1, 0xa5b /* must have exactly 1 field in batch */);\n\n\t\tconst fieldCursor = oneFromIterable(fieldCursors);\n\t\tassert(fieldCursor !== undefined, 0xc94 /* expected exactly one field in batch */);\n\n\t\tinitialize(\n\t\t\tcheckout,\n\t\t\tnewSchema,\n\t\t\tinitializerFromChunk(checkout, () =>\n\t\t\t\tcombineChunks(checkout.forest.chunkField(fieldCursor)),\n\t\t\t),\n\t\t);\n\t}\n\n\treturn {\n\t\tviewWith<TRoot extends ImplicitFieldSchema>(\n\t\t\tconfig: TreeViewConfiguration<TRoot>,\n\t\t): TreeView<TRoot> {\n\t\t\tconst out: TreeViewAlpha<TSchema> = new SchematizingSimpleTreeView<TSchema>(\n\t\t\t\tcheckout,\n\t\t\t\tconfig as TreeViewConfiguration as TreeViewConfiguration<ReadSchema<TSchema>>,\n\t\t\t\tcreateNodeIdentifierManager(idCompressor),\n\t\t\t);\n\t\t\treturn out as unknown as TreeView<TRoot>;\n\t\t},\n\n\t\texportVerbose(): VerboseTree | undefined {\n\t\t\treturn checkout.exportVerbose();\n\t\t},\n\n\t\texportSimpleSchema(): SimpleTreeSchema {\n\t\t\treturn exportSimpleSchema(checkout.storedSchema);\n\t\t},\n\t};\n}\n\n/**\n * The portion of SharedTree data typically persisted by the container.\n * Usable with {@link independentInitializedView} to create a {@link TreeView}\n * without loading a container.\n * @alpha\n */\nexport interface ViewContent {\n\t/**\n\t * Compressed tree from {@link (TreeAlpha:interface).exportCompressed}.\n\t * @remarks\n\t * This is an owning reference:\n\t * consumers of this content might modify this data in place (for example when applying edits) to avoid copying.\n\t */\n\treadonly tree: JsonCompatible<IFluidHandle>;\n\t/**\n\t * Persisted schema from {@link extractPersistedSchema}.\n\t */\n\treadonly schema: JsonCompatible;\n\t/**\n\t * IIdCompressor which will be used to decompress any compressed identifiers in `tree`\n\t * as well as for any other identifiers added to the view.\n\t */\n\treadonly idCompressor: IIdCompressor;\n}\n"]}
1
+ {"version":3,"file":"independentView.js","sourceRoot":"","sources":["../../src/shared-tree/independentView.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kEAA6D;AAC7D,qEAGgD;AAGhD,+CAI0B;AAC1B,4DAQuC;AACvC,4DAA8D;AAY9D,+CAK0B;AAE1B,2DAAuE;AACvE,uEAAuE;AACvE,mDAKyB;AACzB,uDAAuD;AAyCvD;;;;;;;;GAQG;AACH,SAAgB,eAAe,CAC9B,MAAsC,EACtC,OAAgC;IAEhC,OAAO,0BAA0B,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,MAAM,CAA2B,CAAC;AACvF,CAAC;AALD,0CAKC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,0BAA0B,CACzC,MAAsC,EACtC,OAAsC,EACtC,OAAoB;IAEpB,OAAO,0BAA0B,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,QAAQ,CAClE,MAAM,CACoB,CAAC;AAC7B,CAAC;AARD,gEAQC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,SAAgB,yBAAyB,CACxC,OAAuB;IAEvB,OAAO,0BAA0B,CAAU,OAAO,CAAC,CAAC;AACrD,CAAC;AAJD,8DAIC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,0BAA0B,CACzC,OAA2C;IAE3C,MAAM,OAAO,GAAG,IAAI,oBAAS,CAAC,iBAAiB,CAAC,CAAC;IACjD,MAAM,YAAY,GACjB,OAAO,EAAE,YAAY,IAAI,OAAO,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AC,MAAM,KAAK,CAAC,EAAE,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAElF,MAAM,WAAW,GAAG,IAAA,0BAAe,EAAC,YAAY,CAAC,CAAC;QAClD,IAAA,iBAAM,EAAC,WAAW,KAAK,SAAS,EAAE,KAAK,CAAC,yCAAyC,CAAC,CAAC;QAEnF,IAAA,8BAAU,EACT,QAAQ,EACR,SAAS,EACT,IAAA,wCAAoB,EAAC,QAAQ,EAAE,GAAG,EAAE,CACnC,IAAA,wBAAa,EAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CACtD,CACD,CAAC;IACH,CAAC;IAED,OAAO;QACN,QAAQ,CACP,MAAoC;YAEpC,MAAM,GAAG,GAA2B,IAAI,oDAA0B,CACjE,QAAQ,EACR,MAA6E,EAC7E,IAAA,sCAA2B,EAAC,YAAY,CAAC,CACzC,CAAC;YACF,OAAO,GAAiC,CAAC;QAC1C,CAAC;QAED,aAAa;YACZ,OAAO,QAAQ,CAAC,aAAa,EAAE,CAAC;QACjC,CAAC;QAED,kBAAkB;YACjB,OAAO,IAAA,kCAAkB,EAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;QAClD,CAAC;KACD,CAAC;AACH,CAAC;AA5ED,gEA4EC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\ttype IIdCompressor,\n\tcreateIdCompressor,\n} from \"@fluidframework/id-compressor/internal\";\n\nimport type { CodecWriteOptions, ICodecOptions } from \"../codec/index.js\";\nimport {\n\ttype RevisionTag,\n\tRevisionTagCodec,\n\tTreeStoredSchemaRepository,\n} from \"../core/index.js\";\nimport {\n\tcreateNodeIdentifierManager,\n\tfieldBatchCodecBuilder,\n\ttype FieldBatchEncodingContext,\n\tdefaultSchemaPolicy,\n\tTreeCompressionStrategy,\n\tdefaultIncrementalEncodingPolicy,\n\tschemaCodecBuilder,\n} from \"../feature-libraries/index.js\";\nimport { combineChunks } from \"../feature-libraries/index.js\";\nimport type {\n\tTreeViewConfiguration,\n\tImplicitFieldSchema,\n\tTreeViewAlpha,\n\tITreeAlpha,\n\tViewableTree,\n\tTreeView,\n\tReadSchema,\n\tVerboseTree,\n\tSimpleTreeSchema,\n} from \"../simple-tree/index.js\";\nimport {\n\ttype JsonCompatibleReadOnly,\n\ttype JsonCompatible,\n\tBreakable,\n\toneFromIterable,\n} from \"../util/index.js\";\n\nimport { initialize, initializerFromChunk } from \"./schematizeTree.js\";\nimport { SchematizingSimpleTreeView } from \"./schematizingTreeView.js\";\nimport {\n\tbuildConfiguredForest,\n\tdefaultSharedTreeOptions,\n\texportSimpleSchema,\n\ttype ForestOptions,\n} from \"./sharedTree.js\";\nimport { createTreeCheckout } from \"./treeCheckout.js\";\n\n/**\n * {@link independentView} options.\n * @alpha @input\n */\nexport interface IndependentViewOptions extends ForestOptions, Partial<CodecWriteOptions> {\n\t/**\n\t * Optional ID compressor for generating and compressing identifiers.\n\t * If not provided, a new one will be created.\n\t */\n\tidCompressor?: IIdCompressor | undefined;\n}\n\n/**\n * {@link createIndependentTreeAlpha} options.\n * @alpha\n */\nexport type CreateIndependentTreeAlphaOptions = ForestOptions &\n\t(\n\t\t| (IndependentViewOptions & {\n\t\t\t\t/**\n\t\t\t\t * Optional content for initializing the tree.\n\t\t\t\t * If not provided, the tree will be uninitialized.\n\t\t\t\t */\n\t\t\t\tcontent?: never;\n\t\t })\n\t\t| (ICodecOptions & {\n\t\t\t\t/**\n\t\t\t\t * Content for initializing the tree.\n\t\t\t\t * The content includes the idCompressor, so idCompressor should not be provided at the top level.\n\t\t\t\t */\n\t\t\t\tcontent: ViewContent;\n\t\t\t\t/**\n\t\t\t\t * Should not be provided when content is specified.\n\t\t\t\t * The idCompressor will be obtained from the content.\n\t\t\t\t */\n\t\t\t\tidCompressor?: never;\n\t\t })\n\t);\n\n/**\n * Create an uninitialized {@link TreeView} that is not tied to any {@link ITree} instance.\n *\n * @remarks\n * Such a view can never experience collaboration or be persisted to to a Fluid Container.\n *\n * This can be useful for testing, as well as use-cases like working on local files instead of documents stored in some Fluid service.\n * @alpha\n */\nexport function independentView<const TSchema extends ImplicitFieldSchema>(\n\tconfig: TreeViewConfiguration<TSchema>,\n\toptions?: IndependentViewOptions,\n): TreeViewAlpha<TSchema> {\n\treturn createIndependentTreeAlpha(options).viewWith(config) as TreeViewAlpha<TSchema>;\n}\n\n/**\n * Create an initialized {@link TreeView} that is not tied to any {@link ITree} instance.\n *\n * @remarks\n * Such a view can never experience collaboration or be persisted to to a Fluid Container.\n *\n * This can be useful for testing, as well as use-cases like working on local files instead of documents stored in some Fluid service.\n * @privateRemarks\n * TODO: Providing an API which generates a {@link ViewableTree} extended with export options from {@link ITreeAlpha} and maybe even branching APIs would likely be better that just exposing a {@link TreeViewAlpha}.\n * @alpha\n */\nexport function independentInitializedView<const TSchema extends ImplicitFieldSchema>(\n\tconfig: TreeViewConfiguration<TSchema>,\n\toptions: ForestOptions & ICodecOptions,\n\tcontent: ViewContent,\n): TreeViewAlpha<TSchema> {\n\treturn createIndependentTreeAlpha({ ...options, content }).viewWith(\n\t\tconfig,\n\t) as TreeViewAlpha<TSchema>;\n}\n\n/**\n * Create a {@link ViewableTree} that is not tied to any Fluid runtimes or services.\n *\n * @remarks\n * Such a tree can never experience collaboration or be persisted to to a Fluid Container.\n *\n * This can be useful for testing, as well as use-cases like working on local files instead of documents stored in some Fluid service.\n *\n * @example\n * ```typescript\n * const tree = createIndependentTreeBeta();\n *\n * const stagedConfig = new TreeViewConfiguration({\n * \tschema: SchemaFactoryAlpha.types([\n * \t\tSchemaFactory.number,\n * \t\tSchemaFactoryAlpha.staged(SchemaFactory.string),\n * \t]),\n * });\n * const afterConfig = new TreeViewConfigurationAlpha({\n * \tschema: [SchemaFactory.number, SchemaFactory.string],\n * });\n *\n * // Initialize tree\n * {\n * \tconst view = tree.viewWith(stagedConfig);\n * \tview.initialize(1);\n * \tview.dispose();\n * }\n *\n * // Do schema upgrade\n * {\n * \tconst view = tree.viewWith(afterConfig);\n * \tview.upgradeSchema();\n * \tview.root = \"A\";\n * \tview.dispose();\n * }\n *\n * // Can still view tree with staged schema\n * {\n * \tconst view = tree.viewWith(stagedConfig);\n * \tassert.equal(view.root, \"A\");\n * \tview.dispose();\n * }\n * ```\n * @privateRemarks\n * Before stabilizing this as public, consider if we can instead just expose a better way to create regular Fluid service based SharedTrees for tests.\n * Something like https://github.com/microsoft/FluidFramework/pull/25422 might be a better long term stable/public solution.\n * @beta\n */\nexport function createIndependentTreeBeta<const TSchema extends ImplicitFieldSchema>(\n\toptions?: ForestOptions,\n): ViewableTree {\n\treturn createIndependentTreeAlpha<TSchema>(options);\n}\n\n/**\n * Alpha extensions to {@link createIndependentTreeBeta}.\n *\n * @param options - Configuration options for the independent tree.\n * This can be used to create an uninitialized tree, or `content` can be provided to create an initialized tree.\n * If content is provided, the idCompressor is a required part of it: otherwise it is optional and provided at the top level.\n *\n * @privateRemarks\n * TODO: Support more of {@link ITreeAlpha}, including branching APIs to allow for merges.\n * TODO: Better unify this logic with SharedTreeKernel and SharedTreeCore.\n *\n * Before further stabilizing: consider better ways to handle initialized vs uninitialized trees.\n * Perhaps it would be better to not allow initialize here at all, but expose the ability to load compressed tree content and stored schema via ITree or TreeView?\n * If keeping the option here, maybe a separate function of overload would be better? Or maybe flatten ViewContent inline to deduplicate the idCompressor options?\n * @alpha\n */\nexport function createIndependentTreeAlpha<const TSchema extends ImplicitFieldSchema>(\n\toptions?: CreateIndependentTreeAlphaOptions,\n): ViewableTree & Pick<ITreeAlpha, \"exportVerbose\" | \"exportSimpleSchema\"> {\n\tconst breaker = new Breakable(\"independentView\");\n\tconst idCompressor: IIdCompressor =\n\t\toptions?.idCompressor ?? options?.content?.idCompressor ?? createIdCompressor();\n\tconst mintRevisionTag = (): RevisionTag => idCompressor.generateCompressedId();\n\tconst revisionTagCodec = new RevisionTagCodec(idCompressor);\n\n\t// To ensure the forest is in schema when constructed, start it with an empty schema and set the schema repository content later.\n\tconst schemaRepository = new TreeStoredSchemaRepository();\n\n\tconst forest = buildConfiguredForest(\n\t\tbreaker,\n\t\toptions?.forest ?? defaultSharedTreeOptions.forest,\n\t\tschemaRepository,\n\t\tidCompressor,\n\t\tdefaultIncrementalEncodingPolicy,\n\t);\n\n\tconst checkout = createTreeCheckout(idCompressor, mintRevisionTag, revisionTagCodec, {\n\t\tforest,\n\t\tschema: schemaRepository,\n\t\tbreaker,\n\t\tcodecOptions: options,\n\t});\n\n\tif (options?.content !== undefined) {\n\t\tconst schemaCodec = schemaCodecBuilder.buildDecoder(options);\n\t\tconst fieldBatchCodec = fieldBatchCodecBuilder.buildDecoder(options);\n\t\tconst newSchema = schemaCodec.decode(options.content.schema);\n\n\t\tconst context: FieldBatchEncodingContext = {\n\t\t\tencodeType: TreeCompressionStrategy.Compressed,\n\t\t\tidCompressor,\n\t\t\toriginatorId: idCompressor.localSessionId, // Is this right? If so, why is is needed?\n\t\t\tschema: { schema: newSchema, policy: defaultSchemaPolicy },\n\t\t};\n\t\tconst fieldCursors = fieldBatchCodec.decode(\n\t\t\toptions.content.tree as JsonCompatibleReadOnly,\n\t\t\tcontext,\n\t\t);\n\t\tassert(fieldCursors.length === 1, 0xa5b /* must have exactly 1 field in batch */);\n\n\t\tconst fieldCursor = oneFromIterable(fieldCursors);\n\t\tassert(fieldCursor !== undefined, 0xc94 /* expected exactly one field in batch */);\n\n\t\tinitialize(\n\t\t\tcheckout,\n\t\t\tnewSchema,\n\t\t\tinitializerFromChunk(checkout, () =>\n\t\t\t\tcombineChunks(checkout.forest.chunkField(fieldCursor)),\n\t\t\t),\n\t\t);\n\t}\n\n\treturn {\n\t\tviewWith<TRoot extends ImplicitFieldSchema>(\n\t\t\tconfig: TreeViewConfiguration<TRoot>,\n\t\t): TreeView<TRoot> {\n\t\t\tconst out: TreeViewAlpha<TSchema> = new SchematizingSimpleTreeView<TSchema>(\n\t\t\t\tcheckout,\n\t\t\t\tconfig as TreeViewConfiguration as TreeViewConfiguration<ReadSchema<TSchema>>,\n\t\t\t\tcreateNodeIdentifierManager(idCompressor),\n\t\t\t);\n\t\t\treturn out as unknown as TreeView<TRoot>;\n\t\t},\n\n\t\texportVerbose(): VerboseTree | undefined {\n\t\t\treturn checkout.exportVerbose();\n\t\t},\n\n\t\texportSimpleSchema(): SimpleTreeSchema {\n\t\t\treturn exportSimpleSchema(checkout.storedSchema);\n\t\t},\n\t};\n}\n\n/**\n * The portion of SharedTree data typically persisted by the container.\n * Usable with {@link independentInitializedView} to create a {@link TreeView}\n * without loading a container.\n * @alpha\n */\nexport interface ViewContent {\n\t/**\n\t * Compressed tree from {@link (TreeAlpha:interface).exportCompressed}.\n\t * @remarks\n\t * This is an owning reference:\n\t * consumers of this content might modify this data in place (for example when applying edits) to avoid copying.\n\t */\n\treadonly tree: JsonCompatible<IFluidHandle>;\n\t/**\n\t * Persisted schema from {@link extractPersistedSchema}.\n\t */\n\treadonly schema: JsonCompatible;\n\t/**\n\t * IIdCompressor which will be used to decompress any compressed identifiers in `tree`\n\t * as well as for any other identifiers added to the view.\n\t */\n\treadonly idCompressor: IIdCompressor;\n}\n"]}
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { type ITreePrivate, type SharedTreeOptionsInternal, type SharedTreeOptions, type SharedTreeOptionsBeta, SharedTreeKernel, getBranch, type ForestType, type SharedTreeContentSnapshot, type SharedTreeFormatOptions, buildConfiguredForest, defaultSharedTreeOptions, type ForestOptions, type ITreeInternal, ForestTypeOptimized, ForestTypeExpensiveDebug, ForestTypeReference, exportSimpleSchema, type SharedTreeKernelView, persistedToSimpleSchema, getCodecTreeForSharedTreeFormat, } from "./sharedTree.js";
6
- export { createTreeCheckout, TreeCheckout, type ITreeCheckout, type CheckoutEvents, type ITreeCheckoutFork, type BranchableTree, type TreeBranchFork, } from "./treeCheckout.js";
5
+ export { type ITreePrivate, type SharedTreeOptionsInternal, type SharedTreeOptions, type SharedTreeOptionsBeta, SharedTreeKernel, type ForestType, type SharedTreeContentSnapshot, type SharedTreeFormatOptions, buildConfiguredForest, defaultSharedTreeOptions, type ForestOptions, type ITreeInternal, ForestTypeOptimized, ForestTypeExpensiveDebug, ForestTypeReference, exportSimpleSchema, type SharedTreeKernelView, persistedToSimpleSchema, getCodecTreeForSharedTreeFormat, } from "./sharedTree.js";
6
+ export { createTreeCheckout, TreeCheckout, type ITreeCheckout, type CheckoutEvents, } from "./treeCheckout.js";
7
7
  export { SchematizingSimpleTreeView } from "./schematizingTreeView.js";
8
8
  export { initialize, initializerFromChunk } from "./schematizeTree.js";
9
9
  export type { ISharedTreeEditor, ISchemaEditor, SharedTreeEditBuilder, } from "./sharedTreeEditBuilder.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared-tree/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,gBAAgB,EAChB,SAAS,EACT,KAAK,UAAU,EACf,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,oBAAoB,EACzB,uBAAuB,EACvB,+BAA+B,GAC/B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,kBAAkB,EAClB,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,cAAc,GACnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,0BAA0B,EAAE,M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2BAA2B,CAAC;AAEvE,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEvE,YAAY,EACX,iBAAiB,EACjB,aAAa,EACb,qBAAqB,GACrB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EACN,SAAS,EACT,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACvB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACN,0BAA0B,EAC1B,KAAK,WAAW,EAChB,eAAe,EACf,KAAK,sBAAsB,EAC3B,yBAAyB,EACzB,0BAA0B,EAC1B,KAAK,iCAAiC,GACtC,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EACN,2BAA2B,EAC3B,KAAK,6BAA6B,GAClC,MAAM,6BAA6B,CAAC"}
@@ -4,10 +4,9 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.getCodecTreeForChangeFormat = exports.createIndependentTreeAlpha = exports.createIndependentTreeBeta = exports.independentView = exports.independentInitializedView = exports.TreeAlpha = exports.Tree = exports.initializerFromChunk = exports.initialize = exports.SchematizingSimpleTreeView = exports.TreeCheckout = exports.createTreeCheckout = exports.getCodecTreeForSharedTreeFormat = exports.persistedToSimpleSchema = exports.exportSimpleSchema = exports.ForestTypeReference = exports.ForestTypeExpensiveDebug = exports.ForestTypeOptimized = exports.defaultSharedTreeOptions = exports.buildConfiguredForest = exports.getBranch = exports.SharedTreeKernel = void 0;
7
+ exports.getCodecTreeForChangeFormat = exports.createIndependentTreeAlpha = exports.createIndependentTreeBeta = exports.independentView = exports.independentInitializedView = exports.TreeAlpha = exports.Tree = exports.initializerFromChunk = exports.initialize = exports.SchematizingSimpleTreeView = exports.TreeCheckout = exports.createTreeCheckout = exports.getCodecTreeForSharedTreeFormat = exports.persistedToSimpleSchema = exports.exportSimpleSchema = exports.ForestTypeReference = exports.ForestTypeExpensiveDebug = exports.ForestTypeOptimized = exports.defaultSharedTreeOptions = exports.buildConfiguredForest = exports.SharedTreeKernel = void 0;
8
8
  var sharedTree_js_1 = require("./sharedTree.js");
9
9
  Object.defineProperty(exports, "SharedTreeKernel", { enumerable: true, get: function () { return sharedTree_js_1.SharedTreeKernel; } });
10
- Object.defineProperty(exports, "getBranch", { enumerable: true, get: function () { return sharedTree_js_1.getBranch; } });
11
10
  Object.defineProperty(exports, "buildConfiguredForest", { enumerable: true, get: function () { return sharedTree_js_1.buildConfiguredForest; } });
12
11
  Object.defineProperty(exports, "defaultSharedTreeOptions", { enumerable: true, get: function () { return sharedTree_js_1.defaultSharedTreeOptions; } });
13
12
  Object.defineProperty(exports, "ForestTypeOptimized", { enumerable: true, get: function () { return sharedTree_js_1.ForestTypeOptimized; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared-tree/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iDAqByB;AAhBxB,iHAAA,gBAAgB,OAAA;AAChB,0GAAA,SAAS,OAAA;AAIT,sHAAA,qBAAqB,OAAA;AACrB,yHAAA,wBAAwB,OAAA;AAGxB,oHAAA,mBAAmB,OAAA;AACnB,yHAAA,wBAAwB,OAAA;AACxB,oHAAA,mBAAmB,OAAA;AACnB,mHAAA,kBAAkB,OAAA;AAElB,wHAAA,uBAAuB,OAAA;AACvB,gIAAA,+BAA+B,OAAA;AAGhC,qDAQ2B;AAP1B,qHAAA,kBAAkB,OAAA;AAClB,+GAAA,YAAY,OAAA;AAQb,qEAAuE;AAA9D,qIAAA,0BAA0B,OAAA;AAEnC,yDAAuE;AAA9D,+GAAA,UAAU,OAAA;AAAE,yHAAA,oBAAoB,OAAA;AAQzC,qCAAiC;AAAxB,+FAAA,IAAI,OAAA;AAGb,+CAIwB;AAHvB,yGAAA,SAAS,OAAA;AAKV,2DAQ8B;AAP7B,gIAAA,0BAA0B,OAAA;AAE1B,qHAAA,eAAe,OAAA;AAEf,+HAAA,yBAAyB,OAAA;AACzB,gIAAA,0BAA0B,OAAA;AAM3B,yEAGqC;AAFpC,wIAAA,2BAA2B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype ITreePrivate,\n\ttype SharedTreeOptionsInternal,\n\ttype SharedTreeOptions,\n\ttype SharedTreeOptionsBeta,\n\tSharedTreeKernel,\n\tgetBranch,\n\ttype ForestType,\n\ttype SharedTreeContentSnapshot,\n\ttype SharedTreeFormatOptions,\n\tbuildConfiguredForest,\n\tdefaultSharedTreeOptions,\n\ttype ForestOptions,\n\ttype ITreeInternal,\n\tForestTypeOptimized,\n\tForestTypeExpensiveDebug,\n\tForestTypeReference,\n\texportSimpleSchema,\n\ttype SharedTreeKernelView,\n\tpersistedToSimpleSchema,\n\tgetCodecTreeForSharedTreeFormat,\n} from \"./sharedTree.js\";\n\nexport {\n\tcreateTreeCheckout,\n\tTreeCheckout,\n\ttype ITreeCheckout,\n\ttype CheckoutEvents,\n\ttype ITreeCheckoutFork,\n\ttype BranchableTree,\n\ttype TreeBranchFork,\n} from \"./treeCheckout.js\";\n\nexport { SchematizingSimpleTreeView } from \"./schematizingTreeView.js\";\n\nexport { initialize, initializerFromChunk } from \"./schematizeTree.js\";\n\nexport type {\n\tISharedTreeEditor,\n\tISchemaEditor,\n\tSharedTreeEditBuilder,\n} from \"./sharedTreeEditBuilder.js\";\n\nexport { Tree } from \"./tree.js\";\nexport type { RunTransaction } from \"./tree.js\";\n\nexport {\n\tTreeAlpha,\n\ttype TreeIdentifierUtils,\n\ttype ObservationResults,\n} from \"./treeAlpha.js\";\n\nexport {\n\tindependentInitializedView,\n\ttype ViewContent,\n\tindependentView,\n\ttype IndependentViewOptions,\n\tcreateIndependentTreeBeta,\n\tcreateIndependentTreeAlpha,\n\ttype CreateIndependentTreeAlphaOptions,\n} from \"./independentView.js\";\n\nexport type { SharedTreeChange } from \"./sharedTreeChangeTypes.js\";\n\nexport {\n\tgetCodecTreeForChangeFormat,\n\ttype SharedTreeChangeFormatVersion,\n} from \"./sharedTreeChangeCodecs.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared-tree/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iDAoByB;AAfxB,iHAAA,gBAAgB,OAAA;AAIhB,sHAAA,qBAAqB,OAAA;AACrB,yHAAA,wBAAwB,OAAA;AAGxB,oHAAA,mBAAmB,OAAA;AACnB,yHAAA,wBAAwB,OAAA;AACxB,oHAAA,mBAAmB,OAAA;AACnB,mHAAA,kBAAkB,OAAA;AAElB,wHAAA,uBAAuB,OAAA;AACvB,gIAAA,+BAA+B,OAAA;AAGhC,qDAK2B;AAJ1B,qHAAA,kBAAkB,OAAA;AAClB,+GAAA,YAAY,OAAA;AAKb,qEAAuE;AAA9D,qIAAA,0BAA0B,OAAA;AAEnC,yDAAuE;AAA9D,+GAAA,UAAU,OAAA;AAAE,yHAAA,oBAAoB,OAAA;AAQzC,qCAAiC;AAAxB,+FAAA,IAAI,OAAA;AAGb,+CAIwB;AAHvB,yGAAA,SAAS,OAAA;AAKV,2DAQ8B;AAP7B,gIAAA,0BAA0B,OAAA;AAE1B,qHAAA,eAAe,OAAA;AAEf,+HAAA,yBAAyB,OAAA;AACzB,gIAAA,0BAA0B,OAAA;AAM3B,yEAGqC;AAFpC,wIAAA,2BAA2B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype ITreePrivate,\n\ttype SharedTreeOptionsInternal,\n\ttype SharedTreeOptions,\n\ttype SharedTreeOptionsBeta,\n\tSharedTreeKernel,\n\ttype ForestType,\n\ttype SharedTreeContentSnapshot,\n\ttype SharedTreeFormatOptions,\n\tbuildConfiguredForest,\n\tdefaultSharedTreeOptions,\n\ttype ForestOptions,\n\ttype ITreeInternal,\n\tForestTypeOptimized,\n\tForestTypeExpensiveDebug,\n\tForestTypeReference,\n\texportSimpleSchema,\n\ttype SharedTreeKernelView,\n\tpersistedToSimpleSchema,\n\tgetCodecTreeForSharedTreeFormat,\n} from \"./sharedTree.js\";\n\nexport {\n\tcreateTreeCheckout,\n\tTreeCheckout,\n\ttype ITreeCheckout,\n\ttype CheckoutEvents,\n} from \"./treeCheckout.js\";\n\nexport { SchematizingSimpleTreeView } from \"./schematizingTreeView.js\";\n\nexport { initialize, initializerFromChunk } from \"./schematizeTree.js\";\n\nexport type {\n\tISharedTreeEditor,\n\tISchemaEditor,\n\tSharedTreeEditBuilder,\n} from \"./sharedTreeEditBuilder.js\";\n\nexport { Tree } from \"./tree.js\";\nexport type { RunTransaction } from \"./tree.js\";\n\nexport {\n\tTreeAlpha,\n\ttype TreeIdentifierUtils,\n\ttype ObservationResults,\n} from \"./treeAlpha.js\";\n\nexport {\n\tindependentInitializedView,\n\ttype ViewContent,\n\tindependentView,\n\ttype IndependentViewOptions,\n\tcreateIndependentTreeBeta,\n\tcreateIndependentTreeAlpha,\n\ttype CreateIndependentTreeAlphaOptions,\n} from \"./independentView.js\";\n\nexport type { SharedTreeChange } from \"./sharedTreeChangeTypes.js\";\n\nexport {\n\tgetCodecTreeForChangeFormat,\n\ttype SharedTreeChangeFormatVersion,\n} from \"./sharedTreeChangeCodecs.js\";\n"]}
@@ -4,9 +4,9 @@
4
4
  */
5
5
  import type { HasListeners, IEmitter, Listenable } from "@fluidframework/core-interfaces/internal";
6
6
  import { type NodeIdentifierManager, Context } from "../feature-libraries/index.js";
7
- import { type ImplicitFieldSchema, type SchemaCompatibilityStatus, type TreeView, type TreeViewEvents, type TreeViewConfiguration, type TreeViewAlpha, type InsertableField, type ReadableField, type ReadSchema, type UnsafeUnknownSchema, type TreeBranch, type TreeBranchEvents, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type RunTransactionParams, type TransactionConstraintAlpha, type TreeBranchAlpha } from "../simple-tree/index.js";
7
+ import { type ImplicitFieldSchema, type SchemaCompatibilityStatus, type TreeView, type TreeViewEvents, type TreeViewConfiguration, type TreeViewAlpha, type InsertableField, type ReadableField, type ReadSchema, type UnsafeUnknownSchema, type TreeBranchEvents, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type RunTransactionParams, type TreeBranchAlpha } from "../simple-tree/index.js";
8
8
  import { type Breakable, type JsonCompatibleReadOnly, type WithBreakable } from "../util/index.js";
9
- import type { ITreeCheckout, TreeCheckout } from "./treeCheckout.js";
9
+ import type { TreeCheckout } from "./treeCheckout.js";
10
10
  /**
11
11
  * Creating multiple tree views from the same checkout is not supported. This slot is used to detect if one already
12
12
  * exists and error if creating a second.
@@ -65,24 +65,10 @@ export declare class SchematizingSimpleTreeView<in out TRootSchema extends Impli
65
65
  * Gets the flex-tree context. Throws when disposed or out of schema.
66
66
  */
67
67
  getFlexTreeContext(): Context;
68
- /**
69
- * {@inheritDoc @fluidframework/shared-tree#TreeViewAlpha.runTransaction}
70
- */
71
68
  runTransaction<TSuccessValue, TFailureValue>(transaction: () => TransactionCallbackStatus<TSuccessValue, TFailureValue>, params?: RunTransactionParams): TransactionResultExt<TSuccessValue, TFailureValue>;
72
- /**
73
- * {@inheritDoc @fluidframework/shared-tree#TreeViewAlpha.runTransaction}
74
- */
75
69
  runTransaction(transaction: () => VoidTransactionCallbackStatus | void, params?: RunTransactionParams): TransactionResult;
76
- /**
77
- * {@inheritDoc @fluidframework/shared-tree#TreeViewAlpha.runTransactionAsync}
78
- */
79
70
  runTransactionAsync<TSuccessValue, TFailureValue>(transaction: () => Promise<TransactionCallbackStatus<TSuccessValue, TFailureValue>>, params?: RunTransactionParams): Promise<TransactionResultExt<TSuccessValue, TFailureValue>>;
80
- /**
81
- * {@inheritDoc @fluidframework/shared-tree#TreeViewAlpha.runTransactionAsync}
82
- */
83
71
  runTransactionAsync(transaction: () => Promise<VoidTransactionCallbackStatus | void>, params?: RunTransactionParams): Promise<TransactionResult>;
84
- private mountTransaction;
85
- private unmountTransaction;
86
72
  private ensureUndisposed;
87
73
  private failDisposed;
88
74
  /**
@@ -108,24 +94,4 @@ export declare class SchematizingSimpleTreeView<in out TRootSchema extends Impli
108
94
  merge(context: TreeBranchAlpha, disposeMerged?: boolean): void;
109
95
  rebaseOnto(context: TreeBranchAlpha): void;
110
96
  }
111
- /**
112
- * Get the {@link TreeCheckout} associated with a given {@link TreeBranch}.
113
- * @remarks Currently, all contexts are also {@link SchematizingSimpleTreeView}s.
114
- * Other checkout implementations (e.g. not associated with a view) may be supported in the future.
115
- */
116
- export declare function getCheckout(context: TreeBranch): TreeCheckout;
117
- /**
118
- * Adds constraints to a `checkout`'s pending transaction.
119
- *
120
- * @param checkout - The checkout's who's transaction will have the constraints added to it.
121
- * @param constraintsOnRevert - If true, use {@link ISharedTreeEditor.addNodeExistsConstraintOnRevert}.
122
- * @param constraints - The constraints to add to the transaction.
123
- *
124
- * @see {@link RunTransactionParams.preconditions}.
125
- */
126
- export declare function addConstraintsToTransaction(checkout: ITreeCheckout, constraintsOnRevert: boolean, constraints?: readonly TransactionConstraintAlpha[]): void;
127
- /**
128
- * Throws if the given {@link TransactionConstraintAlpha | transaction constraint} is not currently satisfied.
129
- */
130
- export declare function assertValidConstraint(constraint: TransactionConstraintAlpha, onRevert: boolean): void;
131
97
  //# sourceMappingURL=schematizingTreeView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schematizingTreeView.d.ts","sourceRoot":"","sources":["../../src/shared-tree/schematizingTreeView.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACX,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,MAAM,0CAA0C,CAAC;AAKlD,OAAO,EACN,KAAK,qBAAqB,EAI1B,OAAO,EAMP,MAAM,+B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perty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
43
43
  };
44
44
  Object.defineProperty(exports, "__esModule", { value: true });
45
- exports.assertValidConstraint = exports.addConstraintsToTransaction = exports.getCheckout = exports.SchematizingSimpleTreeView = exports.ViewSlot = void 0;
45
+ exports.SchematizingSimpleTreeView = exports.ViewSlot = void 0;
46
46
  const client_utils_1 = require("@fluid-internal/client-utils");
47
47
  const internal_1 = require("@fluidframework/core-utils/internal");
48
48
  const internal_2 = require("@fluidframework/telemetry-utils/internal");
@@ -181,47 +181,21 @@ let SchematizingSimpleTreeView = (() => {
181
181
  return this.flexTreeContext;
182
182
  }
183
183
  runTransaction(transaction, params) {
184
- this.mountTransaction(params, false);
185
- const transactionCallbackStatus = transaction();
186
- return this.unmountTransaction(transactionCallbackStatus, params);
187
- }
188
- async runTransactionAsync(transaction, params) {
189
- this.mountTransaction(params, true);
190
- const transactionCallbackStatus = await transaction();
191
- return this.unmountTransaction(transactionCallbackStatus, params);
192
- }
193
- mountTransaction(params, isAsync) {
194
184
  this.ensureUndisposed();
195
- const { checkout } = this;
196
- if (isAsync && checkout.transaction.size > 0) {
197
- throw new internal_2.UsageError("An asynchronous transaction cannot be started while another transaction is already in progress.");
198
- }
199
- checkout.pushLabelFrame(params?.label);
200
- checkout.transaction.start();
201
- // Validate preconditions before running the transaction callback.
202
- addConstraintsToTransaction(checkout, false /* constraintsOnRevert */, params?.preconditions);
185
+ return this.checkout.runTransaction(transaction, params);
203
186
  }
204
- unmountTransaction(transactionCallbackStatus, params) {
187
+ async runTransactionAsync(transaction, params) {
205
188
  this.ensureUndisposed();
206
- const { checkout } = this;
207
- const rollback = transactionCallbackStatus?.rollback;
208
- const value = transactionCallbackStatus?.value;
209
- if (rollback === true) {
210
- checkout.popLabelFrame(true);
211
- checkout.transaction.abort();
212
- return value === undefined
213
- ? { success: false }
214
- : { success: false, value: value };
189
+ if (this.checkout.transaction.size > 0) {
190
+ // breaker.break() sets brokenBy synchronously before throwing.
191
+ // A plain `throw` inside an async function would be captured as a rejected Promise
192
+ // before @breakingClass could set brokenBy. By setting it here first, the
193
+ // subsequent call to unmountTransaction (also @breakingClass-wrapped) will see the
194
+ // broken state and throw synchronously, propagating out of the outer runTransaction
195
+ // to its caller.
196
+ this.breaker.break(new internal_2.UsageError("An asynchronous transaction cannot be started while another transaction is already in progress."));
215
197
  }
216
- // Validate preconditions on revert after running the transaction callback and was successful.
217
- addConstraintsToTransaction(checkout, true /* constraintsOnRevert */, transactionCallbackStatus?.preconditionsOnRevert);
218
- checkout.popLabelFrame(false);
219
- checkout.runWithTransactionLabel(() => {
220
- checkout.transaction.commit();
221
- }, params?.label);
222
- return value === undefined
223
- ? { success: true }
224
- : { success: true, value: value };
198
+ return this.checkout.runTransactionAsync(transaction, params);
225
199
  }
226
200
  ensureUndisposed() {
227
201
  if (this.disposed) {
@@ -362,13 +336,13 @@ let SchematizingSimpleTreeView = (() => {
362
336
  }
363
337
  // #region Branching
364
338
  fork() {
365
- return this.checkout.branch().viewWith(this.config);
339
+ return this.checkout.fork().viewWith(this.config);
366
340
  }
367
341
  merge(context, disposeMerged = true) {
368
- this.checkout.merge(getCheckout(context), disposeMerged);
342
+ this.checkout.merge(context, disposeMerged);
369
343
  }
370
344
  rebaseOnto(context) {
371
- getCheckout(context).rebase(this.checkout);
345
+ this.checkout.rebaseOnto(context);
372
346
  }
373
347
  };
374
348
  __setFunctionName(_classThis, "SchematizingSimpleTreeView");
@@ -382,80 +356,4 @@ let SchematizingSimpleTreeView = (() => {
382
356
  return SchematizingSimpleTreeView = _classThis;
383
357
  })();
384
358
  exports.SchematizingSimpleTreeView = SchematizingSimpleTreeView;
385
- /**
386
- * Get the {@link TreeCheckout} associated with a given {@link TreeBranch}.
387
- * @remarks Currently, all contexts are also {@link SchematizingSimpleTreeView}s.
388
- * Other checkout implementations (e.g. not associated with a view) may be supported in the future.
389
- */
390
- function getCheckout(context) {
391
- if (context instanceof SchematizingSimpleTreeView) {
392
- return context.checkout;
393
- }
394
- throw new internal_2.UsageError("Unsupported context implementation");
395
- }
396
- exports.getCheckout = getCheckout;
397
- /**
398
- * Adds constraints to a `checkout`'s pending transaction.
399
- *
400
- * @param checkout - The checkout's who's transaction will have the constraints added to it.
401
- * @param constraintsOnRevert - If true, use {@link ISharedTreeEditor.addNodeExistsConstraintOnRevert}.
402
- * @param constraints - The constraints to add to the transaction.
403
- *
404
- * @see {@link RunTransactionParams.preconditions}.
405
- */
406
- function addConstraintsToTransaction(checkout, constraintsOnRevert, constraints = []) {
407
- for (const constraint of constraints) {
408
- assertValidConstraint(constraint, constraintsOnRevert);
409
- const constraintType = constraint.type;
410
- switch (constraintType) {
411
- case "nodeInDocument": {
412
- const node = (0, index_js_3.getInnerNode)(constraint.node);
413
- (0, internal_1.assert)(node.isHydrated(), 0xbc2 /* In document node must be hydrated. */);
414
- if (constraintsOnRevert) {
415
- checkout.editor.addNodeExistsConstraintOnRevert(node.anchorNode);
416
- }
417
- else {
418
- checkout.editor.addNodeExistsConstraint(node.anchorNode);
419
- }
420
- break;
421
- }
422
- case "noChange": {
423
- if (constraintsOnRevert) {
424
- checkout.editor.addNoChangeConstraintOnRevert();
425
- }
426
- else {
427
- checkout.editor.addNoChangeConstraint();
428
- }
429
- break;
430
- }
431
- default: {
432
- (0, internal_1.unreachableCase)(constraintType);
433
- }
434
- }
435
- }
436
- }
437
- exports.addConstraintsToTransaction = addConstraintsToTransaction;
438
- /**
439
- * Throws if the given {@link TransactionConstraintAlpha | transaction constraint} is not currently satisfied.
440
- */
441
- function assertValidConstraint(constraint, onRevert) {
442
- switch (constraint.type) {
443
- case "nodeInDocument": {
444
- const nodeStatus = (0, index_js_3.getKernel)(constraint.node).getStatus();
445
- if (nodeStatus !== index_js_2.TreeStatus.InDocument) {
446
- const revertText = onRevert ? " on revert" : "";
447
- throw new internal_2.UsageError(`Attempted to add a "nodeInDocument" constraint${revertText}, but the node is not currently in the document. Node status: ${nodeStatus}`);
448
- }
449
- break;
450
- }
451
- case "noChange": {
452
- // This constraint is always satisfied at the time of checking, since it just requires that no changes have been made since the transaction callback returned.
453
- break;
454
- }
455
- default: {
456
- (0, internal_1.unreachableCase)(constraint);
457
- }
458
- }
459
- }
460
- exports.assertValidConstraint = assertValidConstraint;
461
359
  //# sourceMappingURL=schematizingTreeView.js.map