@fluidframework/tree 2.4.0-297385 → 2.4.0-299707

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 (349) hide show
  1. package/.dependency-cruiser-known-violations.json +0 -14
  2. package/api-report/tree.alpha.api.md +100 -0
  3. package/dist/alpha.d.ts +20 -1
  4. package/dist/codec/codec.d.ts +4 -4
  5. package/dist/codec/codec.js.map +1 -1
  6. package/dist/codec/noopValidator.d.ts +1 -1
  7. package/dist/codec/noopValidator.js +1 -1
  8. package/dist/codec/noopValidator.js.map +1 -1
  9. package/dist/core/tree/anchorSet.d.ts +159 -2
  10. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  11. package/dist/core/tree/anchorSet.js +54 -12
  12. package/dist/core/tree/anchorSet.js.map +1 -1
  13. package/dist/external-utilities/typeboxValidator.d.ts +1 -1
  14. package/dist/external-utilities/typeboxValidator.js +1 -1
  15. package/dist/external-utilities/typeboxValidator.js.map +1 -1
  16. package/dist/feature-libraries/flex-tree/lazyField.d.ts +4 -0
  17. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  18. package/dist/feature-libraries/flex-tree/lazyField.js +38 -6
  19. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  20. package/dist/feature-libraries/index.d.ts +0 -1
  21. package/dist/feature-libraries/index.d.ts.map +1 -1
  22. package/dist/feature-libraries/index.js +46 -49
  23. package/dist/feature-libraries/index.js.map +1 -1
  24. package/dist/feature-libraries/treeCompressionUtils.d.ts +1 -1
  25. package/dist/feature-libraries/treeCompressionUtils.js +1 -1
  26. package/dist/feature-libraries/treeCompressionUtils.js.map +1 -1
  27. package/dist/index.d.ts +6 -5
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +4 -2
  30. package/dist/index.js.map +1 -1
  31. package/dist/internalTypes.d.ts +1 -1
  32. package/dist/internalTypes.d.ts.map +1 -1
  33. package/dist/internalTypes.js.map +1 -1
  34. package/dist/packageVersion.d.ts +1 -1
  35. package/dist/packageVersion.js +1 -1
  36. package/dist/packageVersion.js.map +1 -1
  37. package/dist/shared-tree/index.d.ts +2 -1
  38. package/dist/shared-tree/index.d.ts.map +1 -1
  39. package/dist/shared-tree/index.js +5 -1
  40. package/dist/shared-tree/index.js.map +1 -1
  41. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  42. package/dist/shared-tree/schematizingTreeView.js +1 -14
  43. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  44. package/dist/shared-tree/sharedTree.d.ts +24 -9
  45. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  46. package/dist/shared-tree/sharedTree.js +20 -8
  47. package/dist/shared-tree/sharedTree.js.map +1 -1
  48. package/dist/simple-tree/api/conciseTree.d.ts +29 -0
  49. package/dist/simple-tree/api/conciseTree.d.ts.map +1 -0
  50. package/dist/simple-tree/api/conciseTree.js +25 -0
  51. package/dist/simple-tree/api/conciseTree.js.map +1 -0
  52. package/dist/simple-tree/api/customTree.d.ts +44 -0
  53. package/dist/simple-tree/api/customTree.d.ts.map +1 -0
  54. package/dist/simple-tree/api/customTree.js +63 -0
  55. package/dist/simple-tree/api/customTree.js.map +1 -0
  56. package/dist/simple-tree/api/index.d.ts +6 -1
  57. package/dist/simple-tree/api/index.d.ts.map +1 -1
  58. package/dist/simple-tree/api/index.js +5 -1
  59. package/dist/simple-tree/api/index.js.map +1 -1
  60. package/dist/simple-tree/api/schemaCreationUtilities.d.ts +41 -26
  61. package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  62. package/dist/simple-tree/api/schemaCreationUtilities.js +43 -15
  63. package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  64. package/dist/simple-tree/api/schemaFactory.d.ts +1 -2
  65. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  66. package/dist/simple-tree/api/schemaFactory.js +8 -8
  67. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  68. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +1 -2
  69. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  70. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  71. package/dist/simple-tree/api/storedSchema.d.ts +78 -0
  72. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -0
  73. package/dist/simple-tree/api/storedSchema.js +107 -0
  74. package/dist/simple-tree/api/storedSchema.js.map +1 -0
  75. package/dist/simple-tree/api/testRecursiveDomain.d.ts +10 -10
  76. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  77. package/dist/simple-tree/api/treeNodeApi.js +5 -5
  78. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  79. package/dist/simple-tree/{typesUnsafe.d.ts → api/typesUnsafe.d.ts} +14 -5
  80. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -0
  81. package/dist/simple-tree/api/typesUnsafe.js.map +1 -0
  82. package/dist/simple-tree/api/verboseTree.d.ts +6 -20
  83. package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
  84. package/dist/simple-tree/api/verboseTree.js +10 -48
  85. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  86. package/dist/simple-tree/arrayNode.d.ts.map +1 -1
  87. package/dist/simple-tree/arrayNode.js +1 -2
  88. package/dist/simple-tree/arrayNode.js.map +1 -1
  89. package/dist/simple-tree/core/index.d.ts +1 -1
  90. package/dist/simple-tree/core/index.d.ts.map +1 -1
  91. package/dist/simple-tree/core/index.js +2 -1
  92. package/dist/simple-tree/core/index.js.map +1 -1
  93. package/dist/simple-tree/core/treeNodeKernel.d.ts +9 -0
  94. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  95. package/dist/simple-tree/core/treeNodeKernel.js +14 -1
  96. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  97. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  98. package/dist/simple-tree/core/unhydratedFlexTree.js +3 -1
  99. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  100. package/dist/simple-tree/flexList.d.ts.map +1 -0
  101. package/dist/simple-tree/flexList.js.map +1 -0
  102. package/dist/simple-tree/index.d.ts +3 -4
  103. package/dist/simple-tree/index.d.ts.map +1 -1
  104. package/dist/simple-tree/index.js +5 -3
  105. package/dist/simple-tree/index.js.map +1 -1
  106. package/dist/simple-tree/mapNode.d.ts.map +1 -1
  107. package/dist/simple-tree/mapNode.js +2 -3
  108. package/dist/simple-tree/mapNode.js.map +1 -1
  109. package/dist/simple-tree/objectNode.d.ts.map +1 -1
  110. package/dist/simple-tree/objectNode.js +3 -4
  111. package/dist/simple-tree/objectNode.js.map +1 -1
  112. package/dist/simple-tree/schemaTypes.d.ts +2 -1
  113. package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
  114. package/dist/simple-tree/schemaTypes.js +5 -5
  115. package/dist/simple-tree/schemaTypes.js.map +1 -1
  116. package/dist/simple-tree/toFlexSchema.d.ts.map +1 -1
  117. package/dist/simple-tree/toFlexSchema.js +13 -15
  118. package/dist/simple-tree/toFlexSchema.js.map +1 -1
  119. package/dist/simple-tree/toMapTree.js +3 -3
  120. package/dist/simple-tree/toMapTree.js.map +1 -1
  121. package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
  122. package/dist/simple-tree/treeNodeValid.js +2 -1
  123. package/dist/simple-tree/treeNodeValid.js.map +1 -1
  124. package/dist/treeFactory.d.ts +1 -0
  125. package/dist/treeFactory.d.ts.map +1 -1
  126. package/dist/treeFactory.js +1 -0
  127. package/dist/treeFactory.js.map +1 -1
  128. package/dist/util/utils.d.ts +10 -8
  129. package/dist/util/utils.d.ts.map +1 -1
  130. package/dist/util/utils.js.map +1 -1
  131. package/docs/main/detached-trees.md +8 -8
  132. package/lib/alpha.d.ts +20 -1
  133. package/lib/codec/codec.d.ts +4 -4
  134. package/lib/codec/codec.js.map +1 -1
  135. package/lib/codec/noopValidator.d.ts +1 -1
  136. package/lib/codec/noopValidator.js +1 -1
  137. package/lib/codec/noopValidator.js.map +1 -1
  138. package/lib/core/tree/anchorSet.d.ts +159 -2
  139. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  140. package/lib/core/tree/anchorSet.js +54 -12
  141. package/lib/core/tree/anchorSet.js.map +1 -1
  142. package/lib/external-utilities/typeboxValidator.d.ts +1 -1
  143. package/lib/external-utilities/typeboxValidator.js +1 -1
  144. package/lib/external-utilities/typeboxValidator.js.map +1 -1
  145. package/lib/feature-libraries/flex-tree/lazyField.d.ts +4 -0
  146. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  147. package/lib/feature-libraries/flex-tree/lazyField.js +36 -5
  148. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  149. package/lib/feature-libraries/index.d.ts +0 -1
  150. package/lib/feature-libraries/index.d.ts.map +1 -1
  151. package/lib/feature-libraries/index.js +0 -1
  152. package/lib/feature-libraries/index.js.map +1 -1
  153. package/lib/feature-libraries/treeCompressionUtils.d.ts +1 -1
  154. package/lib/feature-libraries/treeCompressionUtils.js +1 -1
  155. package/lib/feature-libraries/treeCompressionUtils.js.map +1 -1
  156. package/lib/index.d.ts +6 -5
  157. package/lib/index.d.ts.map +1 -1
  158. package/lib/index.js +3 -3
  159. package/lib/index.js.map +1 -1
  160. package/lib/internalTypes.d.ts +1 -1
  161. package/lib/internalTypes.d.ts.map +1 -1
  162. package/lib/internalTypes.js.map +1 -1
  163. package/lib/packageVersion.d.ts +1 -1
  164. package/lib/packageVersion.js +1 -1
  165. package/lib/packageVersion.js.map +1 -1
  166. package/lib/shared-tree/index.d.ts +2 -1
  167. package/lib/shared-tree/index.d.ts.map +1 -1
  168. package/lib/shared-tree/index.js +2 -1
  169. package/lib/shared-tree/index.js.map +1 -1
  170. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  171. package/lib/shared-tree/schematizingTreeView.js +2 -15
  172. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  173. package/lib/shared-tree/sharedTree.d.ts +24 -9
  174. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  175. package/lib/shared-tree/sharedTree.js +19 -8
  176. package/lib/shared-tree/sharedTree.js.map +1 -1
  177. package/lib/simple-tree/api/conciseTree.d.ts +29 -0
  178. package/lib/simple-tree/api/conciseTree.d.ts.map +1 -0
  179. package/lib/simple-tree/api/conciseTree.js +21 -0
  180. package/lib/simple-tree/api/conciseTree.js.map +1 -0
  181. package/lib/simple-tree/api/customTree.d.ts +44 -0
  182. package/lib/simple-tree/api/customTree.d.ts.map +1 -0
  183. package/lib/simple-tree/api/customTree.js +59 -0
  184. package/lib/simple-tree/api/customTree.js.map +1 -0
  185. package/lib/simple-tree/api/index.d.ts +6 -1
  186. package/lib/simple-tree/api/index.d.ts.map +1 -1
  187. package/lib/simple-tree/api/index.js +1 -0
  188. package/lib/simple-tree/api/index.js.map +1 -1
  189. package/lib/simple-tree/api/schemaCreationUtilities.d.ts +41 -26
  190. package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  191. package/lib/simple-tree/api/schemaCreationUtilities.js +43 -15
  192. package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  193. package/lib/simple-tree/api/schemaFactory.d.ts +1 -2
  194. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  195. package/lib/simple-tree/api/schemaFactory.js +1 -1
  196. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  197. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +1 -2
  198. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  199. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  200. package/lib/simple-tree/api/storedSchema.d.ts +78 -0
  201. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -0
  202. package/lib/simple-tree/api/storedSchema.js +101 -0
  203. package/lib/simple-tree/api/storedSchema.js.map +1 -0
  204. package/lib/simple-tree/api/testRecursiveDomain.d.ts +10 -10
  205. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  206. package/lib/simple-tree/api/treeNodeApi.js +3 -3
  207. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  208. package/lib/simple-tree/{typesUnsafe.d.ts → api/typesUnsafe.d.ts} +14 -5
  209. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -0
  210. package/lib/simple-tree/api/typesUnsafe.js.map +1 -0
  211. package/lib/simple-tree/api/verboseTree.d.ts +6 -20
  212. package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
  213. package/lib/simple-tree/api/verboseTree.js +11 -49
  214. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  215. package/lib/simple-tree/arrayNode.d.ts.map +1 -1
  216. package/lib/simple-tree/arrayNode.js +1 -2
  217. package/lib/simple-tree/arrayNode.js.map +1 -1
  218. package/lib/simple-tree/core/index.d.ts +1 -1
  219. package/lib/simple-tree/core/index.d.ts.map +1 -1
  220. package/lib/simple-tree/core/index.js +1 -1
  221. package/lib/simple-tree/core/index.js.map +1 -1
  222. package/lib/simple-tree/core/treeNodeKernel.d.ts +9 -0
  223. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  224. package/lib/simple-tree/core/treeNodeKernel.js +12 -0
  225. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  226. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  227. package/lib/simple-tree/core/unhydratedFlexTree.js +3 -1
  228. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  229. package/lib/simple-tree/flexList.d.ts.map +1 -0
  230. package/lib/simple-tree/flexList.js.map +1 -0
  231. package/lib/simple-tree/index.d.ts +3 -4
  232. package/lib/simple-tree/index.d.ts.map +1 -1
  233. package/lib/simple-tree/index.js +2 -3
  234. package/lib/simple-tree/index.js.map +1 -1
  235. package/lib/simple-tree/mapNode.d.ts.map +1 -1
  236. package/lib/simple-tree/mapNode.js +1 -2
  237. package/lib/simple-tree/mapNode.js.map +1 -1
  238. package/lib/simple-tree/objectNode.d.ts.map +1 -1
  239. package/lib/simple-tree/objectNode.js +1 -2
  240. package/lib/simple-tree/objectNode.js.map +1 -1
  241. package/lib/simple-tree/schemaTypes.d.ts +2 -1
  242. package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
  243. package/lib/simple-tree/schemaTypes.js +1 -1
  244. package/lib/simple-tree/schemaTypes.js.map +1 -1
  245. package/lib/simple-tree/toFlexSchema.d.ts.map +1 -1
  246. package/lib/simple-tree/toFlexSchema.js +1 -3
  247. package/lib/simple-tree/toFlexSchema.js.map +1 -1
  248. package/lib/simple-tree/toMapTree.js +3 -3
  249. package/lib/simple-tree/toMapTree.js.map +1 -1
  250. package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
  251. package/lib/simple-tree/treeNodeValid.js +2 -1
  252. package/lib/simple-tree/treeNodeValid.js.map +1 -1
  253. package/lib/treeFactory.d.ts +1 -0
  254. package/lib/treeFactory.d.ts.map +1 -1
  255. package/lib/treeFactory.js +1 -0
  256. package/lib/treeFactory.js.map +1 -1
  257. package/lib/util/utils.d.ts +10 -8
  258. package/lib/util/utils.d.ts.map +1 -1
  259. package/lib/util/utils.js.map +1 -1
  260. package/package.json +26 -25
  261. package/src/codec/codec.ts +4 -4
  262. package/src/codec/noopValidator.ts +1 -1
  263. package/src/core/tree/anchorSet.ts +63 -13
  264. package/src/external-utilities/typeboxValidator.ts +1 -1
  265. package/src/feature-libraries/flex-tree/lazyField.ts +44 -7
  266. package/src/feature-libraries/index.ts +0 -10
  267. package/src/feature-libraries/treeCompressionUtils.ts +1 -1
  268. package/src/index.ts +17 -6
  269. package/src/internalTypes.ts +1 -1
  270. package/src/packageVersion.ts +1 -1
  271. package/src/shared-tree/index.ts +5 -0
  272. package/src/shared-tree/schematizingTreeView.ts +7 -16
  273. package/src/shared-tree/sharedTree.ts +52 -22
  274. package/src/simple-tree/api/conciseTree.ts +58 -0
  275. package/src/simple-tree/api/customTree.ts +119 -0
  276. package/src/simple-tree/api/index.ts +34 -1
  277. package/src/simple-tree/api/schemaCreationUtilities.ts +55 -36
  278. package/src/simple-tree/api/schemaFactory.ts +4 -6
  279. package/src/simple-tree/api/schemaFactoryRecursive.ts +1 -2
  280. package/src/simple-tree/api/storedSchema.ts +126 -0
  281. package/src/simple-tree/api/treeNodeApi.ts +3 -8
  282. package/src/simple-tree/{typesUnsafe.ts → api/typesUnsafe.ts} +15 -5
  283. package/src/simple-tree/api/verboseTree.ts +21 -76
  284. package/src/simple-tree/arrayNode.ts +1 -1
  285. package/src/simple-tree/core/index.ts +1 -0
  286. package/src/simple-tree/core/treeNodeKernel.ts +13 -0
  287. package/src/simple-tree/core/unhydratedFlexTree.ts +6 -1
  288. package/src/simple-tree/index.ts +26 -20
  289. package/src/simple-tree/mapNode.ts +1 -1
  290. package/src/simple-tree/objectNode.ts +1 -1
  291. package/src/simple-tree/schemaTypes.ts +2 -6
  292. package/src/simple-tree/toFlexSchema.ts +1 -3
  293. package/src/simple-tree/toMapTree.ts +3 -3
  294. package/src/simple-tree/treeNodeValid.ts +2 -1
  295. package/src/treeFactory.ts +1 -0
  296. package/src/util/utils.ts +10 -8
  297. package/dist/feature-libraries/flex-tree/unboxed.d.ts +0 -12
  298. package/dist/feature-libraries/flex-tree/unboxed.d.ts.map +0 -1
  299. package/dist/feature-libraries/flex-tree/unboxed.js +0 -20
  300. package/dist/feature-libraries/flex-tree/unboxed.js.map +0 -1
  301. package/dist/feature-libraries/typed-schema/flexList.d.ts.map +0 -1
  302. package/dist/feature-libraries/typed-schema/flexList.js.map +0 -1
  303. package/dist/feature-libraries/typed-schema/index.d.ts +0 -7
  304. package/dist/feature-libraries/typed-schema/index.d.ts.map +0 -1
  305. package/dist/feature-libraries/typed-schema/index.js +0 -12
  306. package/dist/feature-libraries/typed-schema/index.js.map +0 -1
  307. package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts +0 -14
  308. package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +0 -1
  309. package/dist/feature-libraries/typed-schema/typedTreeSchema.js +0 -7
  310. package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +0 -1
  311. package/dist/simple-tree/proxyBinding.d.ts +0 -15
  312. package/dist/simple-tree/proxyBinding.d.ts.map +0 -1
  313. package/dist/simple-tree/proxyBinding.js +0 -22
  314. package/dist/simple-tree/proxyBinding.js.map +0 -1
  315. package/dist/simple-tree/typesUnsafe.d.ts.map +0 -1
  316. package/dist/simple-tree/typesUnsafe.js.map +0 -1
  317. package/lib/feature-libraries/flex-tree/unboxed.d.ts +0 -12
  318. package/lib/feature-libraries/flex-tree/unboxed.d.ts.map +0 -1
  319. package/lib/feature-libraries/flex-tree/unboxed.js +0 -16
  320. package/lib/feature-libraries/flex-tree/unboxed.js.map +0 -1
  321. package/lib/feature-libraries/typed-schema/flexList.d.ts.map +0 -1
  322. package/lib/feature-libraries/typed-schema/flexList.js.map +0 -1
  323. package/lib/feature-libraries/typed-schema/index.d.ts +0 -7
  324. package/lib/feature-libraries/typed-schema/index.d.ts.map +0 -1
  325. package/lib/feature-libraries/typed-schema/index.js +0 -6
  326. package/lib/feature-libraries/typed-schema/index.js.map +0 -1
  327. package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts +0 -14
  328. package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +0 -1
  329. package/lib/feature-libraries/typed-schema/typedTreeSchema.js +0 -6
  330. package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +0 -1
  331. package/lib/simple-tree/proxyBinding.d.ts +0 -15
  332. package/lib/simple-tree/proxyBinding.d.ts.map +0 -1
  333. package/lib/simple-tree/proxyBinding.js +0 -18
  334. package/lib/simple-tree/proxyBinding.js.map +0 -1
  335. package/lib/simple-tree/typesUnsafe.d.ts.map +0 -1
  336. package/lib/simple-tree/typesUnsafe.js.map +0 -1
  337. package/src/feature-libraries/flex-tree/unboxed.ts +0 -24
  338. package/src/feature-libraries/typed-schema/README.md +0 -6
  339. package/src/feature-libraries/typed-schema/index.ts +0 -16
  340. package/src/feature-libraries/typed-schema/typedTreeSchema.ts +0 -14
  341. package/src/simple-tree/proxyBinding.ts +0 -20
  342. /package/dist/simple-tree/{typesUnsafe.js → api/typesUnsafe.js} +0 -0
  343. /package/dist/{feature-libraries/typed-schema → simple-tree}/flexList.d.ts +0 -0
  344. /package/dist/{feature-libraries/typed-schema → simple-tree}/flexList.js +0 -0
  345. /package/lib/simple-tree/{typesUnsafe.js → api/typesUnsafe.js} +0 -0
  346. /package/lib/{feature-libraries/typed-schema → simple-tree}/flexList.d.ts +0 -0
  347. /package/lib/{feature-libraries/typed-schema → simple-tree}/flexList.js +0 -0
  348. /package/src/simple-tree/{ProxyBinding.md → core/TreeNodeBinding.md} +0 -0
  349. /package/src/{feature-libraries/typed-schema → simple-tree}/flexList.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/tree",
3
- "version": "2.4.0-297385",
3
+ "version": "2.4.0-299707",
4
4
  "description": "Distributed tree",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -71,11 +71,13 @@
71
71
  "cache-dir": "nyc/.cache",
72
72
  "exclude": [
73
73
  "src/test/**/*.*ts",
74
+ "dist/test/**/*.*js",
74
75
  "lib/test/**/*.*js"
75
76
  ],
76
77
  "exclude-after-remap": false,
77
78
  "include": [
78
79
  "src/**/*.*ts",
80
+ "dist/**/*.*js",
79
81
  "lib/**/*.*js"
80
82
  ],
81
83
  "report-dir": "nyc/report",
@@ -87,38 +89,38 @@
87
89
  "temp-directory": "nyc/.nyc_output"
88
90
  },
89
91
  "dependencies": {
90
- "@fluid-internal/client-utils": "2.4.0-297385",
91
- "@fluidframework/container-runtime": "2.4.0-297385",
92
- "@fluidframework/core-interfaces": "2.4.0-297385",
93
- "@fluidframework/core-utils": "2.4.0-297385",
94
- "@fluidframework/datastore-definitions": "2.4.0-297385",
95
- "@fluidframework/driver-definitions": "2.4.0-297385",
96
- "@fluidframework/id-compressor": "2.4.0-297385",
97
- "@fluidframework/runtime-definitions": "2.4.0-297385",
98
- "@fluidframework/runtime-utils": "2.4.0-297385",
99
- "@fluidframework/shared-object-base": "2.4.0-297385",
100
- "@fluidframework/telemetry-utils": "2.4.0-297385",
92
+ "@fluid-internal/client-utils": "2.4.0-299707",
93
+ "@fluidframework/container-runtime": "2.4.0-299707",
94
+ "@fluidframework/core-interfaces": "2.4.0-299707",
95
+ "@fluidframework/core-utils": "2.4.0-299707",
96
+ "@fluidframework/datastore-definitions": "2.4.0-299707",
97
+ "@fluidframework/driver-definitions": "2.4.0-299707",
98
+ "@fluidframework/id-compressor": "2.4.0-299707",
99
+ "@fluidframework/runtime-definitions": "2.4.0-299707",
100
+ "@fluidframework/runtime-utils": "2.4.0-299707",
101
+ "@fluidframework/shared-object-base": "2.4.0-299707",
102
+ "@fluidframework/telemetry-utils": "2.4.0-299707",
101
103
  "@sinclair/typebox": "^0.32.29",
102
104
  "@tylerbu/sorted-btree-es6": "^1.8.0",
103
105
  "@ungap/structured-clone": "^1.2.0",
104
106
  "uuid": "^9.0.0"
105
107
  },
106
108
  "devDependencies": {
107
- "@arethetypeswrong/cli": "^0.15.2",
109
+ "@arethetypeswrong/cli": "^0.16.4",
108
110
  "@biomejs/biome": "~1.8.3",
109
- "@fluid-internal/mocha-test-setup": "2.4.0-297385",
110
- "@fluid-private/stochastic-test-utils": "2.4.0-297385",
111
- "@fluid-private/test-dds-utils": "2.4.0-297385",
112
- "@fluid-private/test-drivers": "2.4.0-297385",
111
+ "@fluid-internal/mocha-test-setup": "2.4.0-299707",
112
+ "@fluid-private/stochastic-test-utils": "2.4.0-299707",
113
+ "@fluid-private/test-dds-utils": "2.4.0-299707",
114
+ "@fluid-private/test-drivers": "2.4.0-299707",
113
115
  "@fluid-tools/benchmark": "^0.50.0",
114
- "@fluid-tools/build-cli": "^0.46.0",
116
+ "@fluid-tools/build-cli": "^0.48.0",
115
117
  "@fluidframework/build-common": "^2.0.3",
116
- "@fluidframework/build-tools": "^0.46.0",
117
- "@fluidframework/container-definitions": "2.4.0-297385",
118
- "@fluidframework/container-loader": "2.4.0-297385",
118
+ "@fluidframework/build-tools": "^0.48.0",
119
+ "@fluidframework/container-definitions": "2.4.0-299707",
120
+ "@fluidframework/container-loader": "2.4.0-299707",
119
121
  "@fluidframework/eslint-config-fluid": "^5.4.0",
120
- "@fluidframework/test-runtime-utils": "2.4.0-297385",
121
- "@fluidframework/test-utils": "2.4.0-297385",
122
+ "@fluidframework/test-runtime-utils": "2.4.0-299707",
123
+ "@fluidframework/test-utils": "2.4.0-299707",
122
124
  "@fluidframework/tree-previous": "npm:@fluidframework/tree@~2.3.0",
123
125
  "@microsoft/api-extractor": "7.47.8",
124
126
  "@types/diff": "^3.5.1",
@@ -139,7 +141,6 @@
139
141
  "eslint": "~8.55.0",
140
142
  "eslint-config-prettier": "~9.0.0",
141
143
  "mocha": "^10.2.0",
142
- "mocha-json-output-reporter": "^2.0.1",
143
144
  "mocha-multi-reporters": "^1.5.1",
144
145
  "moment": "^2.21.0",
145
146
  "prettier": "~3.0.3",
@@ -242,7 +243,7 @@
242
243
  "test:mocha:esm": "mocha",
243
244
  "test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
244
245
  "test:snapshots:regen": "pnpm test:mocha:esm --snapshot",
245
- "test:stress": "cross-env FUZZ_TEST_COUNT=20 FUZZ_STRESS_RUN=true mocha --ignore \"lib/test/memory/**/*\" --recursive \"lib/test/**/*.spec.js\"",
246
+ "test:stress": "cross-env FUZZ_TEST_COUNT=20 FUZZ_STRESS_RUN=normal mocha --ignore \"lib/test/memory/**/*\" --recursive \"lib/test/**/*.spec.js\"",
246
247
  "tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist",
247
248
  "typetests:gen": "flub generate typetests --dir . -v",
248
249
  "typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
@@ -35,18 +35,18 @@ export interface IDecoder<TDecoded, TEncoded, TContext> {
35
35
  /**
36
36
  * Validates data complies with some particular schema.
37
37
  * Implementations are typically created by a {@link JsonValidator}.
38
- * @internal
38
+ * @alpha
39
39
  */
40
40
  export interface SchemaValidationFunction<Schema extends TSchema> {
41
41
  /**
42
- * @returns Whether the data matches a schema.
42
+ * Returns whether the data matches a schema.
43
43
  */
44
44
  check(data: unknown): data is Static<Schema>;
45
45
  }
46
46
 
47
47
  /**
48
48
  * JSON schema validator compliant with draft 6 schema. See https://json-schema.org.
49
- * @internal
49
+ * @alpha
50
50
  */
51
51
  export interface JsonValidator {
52
52
  /**
@@ -63,7 +63,7 @@ export interface JsonValidator {
63
63
 
64
64
  /**
65
65
  * Options relating to handling of persisted data.
66
- * @internal
66
+ * @alpha
67
67
  */
68
68
  export interface ICodecOptions {
69
69
  /**
@@ -11,7 +11,7 @@ import type { JsonValidator } from "./codec.js";
11
11
  * A {@link JsonValidator} implementation which performs no validation and accepts all data as valid.
12
12
  * @privateRemarks Having this as an option unifies opting out of validation with selection of
13
13
  * validators, simplifying code performing validation.
14
- * @internal
14
+ * @alpha
15
15
  */
16
16
  export const noopValidator: JsonValidator = {
17
17
  compile: <Schema extends TSchema>() => ({ check: (data): data is Static<Schema> => true }),
@@ -233,6 +233,13 @@ export interface AnchorNode extends UpPath<AnchorNode>, Listenable<AnchorEvents>
233
233
  */
234
234
  child(key: FieldKey, index: number): UpPath<AnchorNode>;
235
235
 
236
+ /**
237
+ * Gets the child AnchorNode if already exists.
238
+ *
239
+ * Does NOT add a ref, so the returned AnchorNode must be used with care.
240
+ */
241
+ childIfAnchored(key: FieldKey, index: number): AnchorNode | undefined;
242
+
236
243
  /**
237
244
  * Gets a child AnchorNode (creating it if needed), and an Anchor owning a ref to it.
238
245
  * Caller is responsible for freeing the returned Anchor, and must not use the AnchorNode after that.
@@ -413,8 +420,10 @@ export class AnchorSet implements Listenable<AnchorSetRootEvents>, AnchorLocator
413
420
 
414
421
  /**
415
422
  * Finds a path node if it already exists.
423
+ *
424
+ * Does not add a ref!
416
425
  */
417
- private find(path: UpPath): PathNode | undefined {
426
+ public find(path: UpPath): PathNode | undefined {
418
427
  if (path instanceof PathNode) {
419
428
  if (path.anchorSet === this) {
420
429
  return path;
@@ -422,7 +431,7 @@ export class AnchorSet implements Listenable<AnchorSetRootEvents>, AnchorLocator
422
431
  }
423
432
  const parent = path.parent ?? this.root;
424
433
  const parentPath = this.find(parent);
425
- return parentPath?.tryGetChild(path.parentField, path.parentIndex);
434
+ return parentPath?.childIfAnchored(path.parentField, path.parentIndex);
426
435
  }
427
436
 
428
437
  /**
@@ -452,7 +461,7 @@ export class AnchorSet implements Listenable<AnchorSetRootEvents>, AnchorLocator
452
461
  while ((wrapWith = stack.pop()) !== undefined) {
453
462
  if (path === undefined || path instanceof PathNode) {
454
463
  // If path already has an anchor, get an anchor for it's child if there is one:
455
- const child = (path ?? this.root).tryGetChild(
464
+ const child = (path ?? this.root).childIfAnchored(
456
465
  wrapWith.parentField,
457
466
  wrapWith.parentIndex,
458
467
  );
@@ -1210,7 +1219,11 @@ class PathNode extends ReferenceCountedBase implements UpPath<PathNode>, AnchorN
1210
1219
  public child(key: FieldKey, index: number): UpPath<AnchorNode> {
1211
1220
  // Fast path: if child exists, return it.
1212
1221
  return (
1213
- this.tryGetChild(key, index) ?? { parent: this, parentField: key, parentIndex: index }
1222
+ this.childIfAnchored(key, index) ?? {
1223
+ parent: this,
1224
+ parentField: key,
1225
+ parentIndex: index,
1226
+ }
1214
1227
  );
1215
1228
  }
1216
1229
 
@@ -1271,8 +1284,7 @@ class PathNode extends ReferenceCountedBase implements UpPath<PathNode>, AnchorN
1271
1284
  field = [];
1272
1285
  this.children.set(key, field);
1273
1286
  }
1274
- // TODO: should do more optimized search (ex: binary search).
1275
- let child = field.find((c) => c.parentIndex === index);
1287
+ let child = binaryFind(field, index);
1276
1288
  if (child === undefined) {
1277
1289
  child = new PathNode(this.anchorSet, key, index, this);
1278
1290
  field.push(child);
@@ -1284,16 +1296,11 @@ class PathNode extends ReferenceCountedBase implements UpPath<PathNode>, AnchorN
1284
1296
  return child;
1285
1297
  }
1286
1298
 
1287
- /**
1288
- * Gets a child if it exists.
1289
- * Does NOT add a ref.
1290
- */
1291
- public tryGetChild(key: FieldKey, index: number): PathNode | undefined {
1299
+ public childIfAnchored(key: FieldKey, index: number): PathNode | undefined {
1292
1300
  assert(this.status === Status.Alive, 0x40d /* PathNode must be alive */);
1293
1301
  const field = this.children.get(key);
1294
1302
 
1295
- // TODO: should do more optimized search (ex: binary search or better) using index.
1296
- return field?.find((c) => c.parentIndex === index);
1303
+ return field === undefined ? undefined : binaryFind(field, index);
1297
1304
  }
1298
1305
 
1299
1306
  /**
@@ -1343,3 +1350,46 @@ class PathNode extends ReferenceCountedBase implements UpPath<PathNode>, AnchorN
1343
1350
  }
1344
1351
  }
1345
1352
  }
1353
+
1354
+ /**
1355
+ * Find a child PathNode by index using a binary search.
1356
+ * @param sorted - array of PathNode's sorted by parentIndex.
1357
+ * @param index - index being looked for.
1358
+ * @returns child with the requested parentIndex, or undefined.
1359
+ * @privateRemarks
1360
+ * This function is very commonly used with small arrays (length 0 or one for all non sequence fields),
1361
+ * and is currently a hot path due to how flex tree leaves to excessive cursor to anchor and anchor to cursor translations,
1362
+ * both of which walk paths down the AnchorSet.
1363
+ * Additionally current usages tends to fully populate the anchor tree leading the correct array index to be the requested parent index.
1364
+ * This makes the performance of this performance both important in small cases and easy to overly tune to the current usage patterns.
1365
+ * This lead to not implementing a general purpose reusable binary search.
1366
+ * Once this function is not so heavily overused due to inefficient patterns in flex-tree,
1367
+ * replacing it with a standard binary search is likely fine.
1368
+ * Until then, care and benchmarking should be used when messing with this function.
1369
+ */
1370
+ function binaryFind(sorted: readonly PathNode[], index: number): PathNode | undefined {
1371
+ // Try guessing the list is not sparse as a starter:
1372
+ const guess = sorted[index];
1373
+ if (guess !== undefined && guess.parentIndex === index) {
1374
+ return guess;
1375
+ }
1376
+
1377
+ // inclusive
1378
+ let min = 0;
1379
+ // exclusive
1380
+ let max = sorted.length;
1381
+
1382
+ while (min !== max) {
1383
+ const mid = Math.floor((min + max) / 2);
1384
+ const item = sorted[mid]!;
1385
+ const found = item.parentIndex;
1386
+ if (found === index) {
1387
+ return item; // Found the target, return it.
1388
+ } else if (found > index) {
1389
+ max = mid; // Continue search on lower half.
1390
+ } else {
1391
+ min = mid + 1; // Continue search on left half.
1392
+ }
1393
+ }
1394
+ return undefined; // If we reach here, target is not in array (or array was not sorted)
1395
+ }
@@ -19,7 +19,7 @@ import type { JsonValidator } from "../codec/index.js";
19
19
  *
20
20
  * Defining this validator in its own file also helps to ensure it is tree-shakeable.
21
21
  *
22
- * @internal
22
+ * @alpha
23
23
  */
24
24
  export const typeboxValidator: JsonValidator = {
25
25
  compile: <Schema extends TSchema>(schema: Schema) => {
@@ -4,8 +4,10 @@
4
4
  */
5
5
 
6
6
  import { assert } from "@fluidframework/core-utils/internal";
7
+ import { UsageError } from "@fluidframework/telemetry-utils/internal";
7
8
 
8
9
  import {
10
+ type AnchorNode,
9
11
  CursorLocationType,
10
12
  type ExclusiveMapTree,
11
13
  type FieldAnchor,
@@ -51,9 +53,7 @@ import {
51
53
  tryMoveCursorToAnchorSymbol,
52
54
  } from "./lazyEntity.js";
53
55
  import { type LazyTreeNode, makeTree } from "./lazyNode.js";
54
- import { unboxedFlexNode } from "./unboxed.js";
55
56
  import { indexForAt, treeStatusFromAnchorCache } from "./utilities.js";
56
- import { UsageError } from "@fluidframework/telemetry-utils/internal";
57
57
  import { cursorForMapTreeField, cursorForMapTreeNode } from "../mapTreeCursor.js";
58
58
 
59
59
  /**
@@ -196,7 +196,7 @@ export abstract class LazyField extends LazyEntity<FieldAnchor> implements FlexT
196
196
 
197
197
  public atIndex(index: number): FlexTreeUnknownUnboxed {
198
198
  return inCursorNode(this[cursorSymbol], index, (cursor) =>
199
- unboxedFlexNode(this.context, cursor),
199
+ unboxedFlexNode(this.context, cursor, this[anchorSymbol]),
200
200
  );
201
201
  }
202
202
 
@@ -222,7 +222,7 @@ export abstract class LazyField extends LazyEntity<FieldAnchor> implements FlexT
222
222
 
223
223
  public [Symbol.iterator](): IterableIterator<FlexTreeUnknownUnboxed> {
224
224
  return iterateCursorField(this[cursorSymbol], (cursor) =>
225
- unboxedFlexNode(this.context, cursor),
225
+ unboxedFlexNode(this.context, cursor, this[anchorSymbol]),
226
226
  );
227
227
  }
228
228
 
@@ -259,9 +259,7 @@ export class LazySequence extends LazyField implements FlexTreeSequenceField {
259
259
  return undefined;
260
260
  }
261
261
 
262
- return inCursorNode(this[cursorSymbol], finalIndex, (cursor) =>
263
- unboxedFlexNode(this.context, cursor),
264
- );
262
+ return this.atIndex(finalIndex);
265
263
  }
266
264
  public get asArray(): readonly FlexTreeUnknownUnboxed[] {
267
265
  return this.map((x) => x);
@@ -352,3 +350,42 @@ const builderList: [FieldKindIdentifier, Builder][] = [
352
350
  ];
353
351
 
354
352
  const kindToClass: ReadonlyMap<FieldKindIdentifier, Builder> = new Map(builderList);
353
+
354
+ /**
355
+ * Returns the flex tree node, or the value if it has one.
356
+ */
357
+ export function unboxedFlexNode(
358
+ context: Context,
359
+ cursor: ITreeSubscriptionCursor,
360
+ fieldAnchor: FieldAnchor,
361
+ ): FlexTreeUnknownUnboxed {
362
+ const value = cursor.value;
363
+ if (value !== undefined) {
364
+ return value;
365
+ }
366
+
367
+ // Try accessing cached child node via anchors.
368
+ // This avoids O(depth) related costs from makeTree in the cached case.
369
+ const anchor = fieldAnchor.parent;
370
+ let child: AnchorNode | undefined;
371
+ if (anchor !== undefined) {
372
+ const anchorNode = context.checkout.forest.anchors.locate(anchor);
373
+ assert(anchorNode !== undefined, "missing anchor");
374
+ child = anchorNode.childIfAnchored(fieldAnchor.fieldKey, cursor.fieldIndex);
375
+ } else {
376
+ child = context.checkout.forest.anchors.find({
377
+ parent: undefined,
378
+ parentField: fieldAnchor.fieldKey,
379
+ parentIndex: cursor.fieldIndex,
380
+ });
381
+ }
382
+
383
+ if (child !== undefined) {
384
+ const cached = child.slots.get(flexTreeSlot);
385
+ if (cached !== undefined) {
386
+ return cached;
387
+ }
388
+ }
389
+
390
+ return makeTree(context, cursor);
391
+ }
@@ -79,16 +79,6 @@ export {
79
79
  isNeverTree,
80
80
  } from "./modular-schema/index.js";
81
81
 
82
- export {
83
- type Unenforced,
84
- markEager,
85
- type LazyItem,
86
- type FlexListToUnion,
87
- type ExtractItemType,
88
- isLazy,
89
- type FlexList,
90
- } from "./typed-schema/index.js";
91
-
92
82
  export { mapRootChanges } from "./deltaUtils.js";
93
83
 
94
84
  export {
@@ -7,7 +7,7 @@
7
7
  * Selects which heuristics to use when encoding tree content.
8
8
  * All encoding options here are compatible with the same decoder:
9
9
  * the selection here does not impact compatibility.
10
- * @internal
10
+ * @alpha
11
11
  */
12
12
  export enum TreeCompressionStrategy {
13
13
  /**
package/src/index.ts CHANGED
@@ -40,9 +40,7 @@ export {
40
40
  } from "./events/index.js";
41
41
 
42
42
  export {
43
- type LazyItem,
44
43
  TreeStatus,
45
- type Unenforced,
46
44
  TreeCompressionStrategy,
47
45
  } from "./feature-libraries/index.js";
48
46
 
@@ -58,6 +56,7 @@ export {
58
56
  type NodeInDocumentConstraint,
59
57
  type RunTransaction,
60
58
  rollback,
59
+ type ForestOptions,
61
60
  getBranch,
62
61
  type TreeBranch,
63
62
  type TreeBranchFork,
@@ -121,12 +120,11 @@ export {
121
120
  // Recursive Schema APIs
122
121
  type ValidateRecursiveSchema,
123
122
  type FixRecursiveArraySchema,
124
- // experimental @internal APIs:
123
+ // experimental @alpha APIs:
125
124
  adaptEnum,
126
125
  enumFromStrings,
127
126
  singletonSchema,
128
127
  typedObjectValues,
129
- type EmptyObject,
130
128
  // test recursive schema for checking that d.ts files handles schema correctly
131
129
  test_RecursiveObject,
132
130
  test_RecursiveObject_base,
@@ -134,6 +132,8 @@ export {
134
132
  // Beta APIs
135
133
  TreeBeta,
136
134
  type TreeChangeEventsBeta,
135
+ extractPersistedSchema,
136
+ comparePersistedSchema,
137
137
  // Back to normal types
138
138
  type JsonTreeSchema,
139
139
  type JsonSchemaId,
@@ -149,10 +149,19 @@ export {
149
149
  type JsonSchemaType,
150
150
  type JsonLeafSchemaType,
151
151
  getJsonSchema,
152
+ type LazyItem,
153
+ type Unenforced,
152
154
  } from "./simple-tree/index.js";
153
- export { SharedTree, configuredSharedTree } from "./treeFactory.js";
155
+ export {
156
+ SharedTree,
157
+ configuredSharedTree,
158
+ } from "./treeFactory.js";
154
159
 
155
- export type { ICodecOptions, JsonValidator, SchemaValidationFunction } from "./codec/index.js";
160
+ export type {
161
+ ICodecOptions,
162
+ JsonValidator,
163
+ SchemaValidationFunction,
164
+ } from "./codec/index.js";
156
165
  export { noopValidator } from "./codec/index.js";
157
166
  export { typeboxValidator } from "./external-utilities/index.js";
158
167
 
@@ -177,3 +186,5 @@ export {
177
186
  // These would be put in `internalTypes` except doing so tents to cause errors like:
178
187
  // 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.
179
188
  export type { MapNodeInsertableData } from "./simple-tree/index.js";
189
+
190
+ export type { JsonCompatible, JsonCompatibleObject } from "./util/index.js";
@@ -34,6 +34,6 @@ export type {
34
34
  NodeFromSchemaUnsafe,
35
35
  ReadonlyMapInlined,
36
36
  } from "./simple-tree/index.js";
37
- export type { FlexList, FlexListToUnion, ExtractItemType } from "./feature-libraries/index.js";
37
+ export type { FlexList, FlexListToUnion, ExtractItemType } from "./simple-tree/index.js";
38
38
 
39
39
  export type { TreeApi } from "./shared-tree/index.js";
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/tree";
9
- export const pkgVersion = "2.4.0-297385";
9
+ export const pkgVersion = "2.4.0-299707";
@@ -13,6 +13,9 @@ export {
13
13
  type SharedTreeContentSnapshot,
14
14
  type SharedTreeFormatOptions,
15
15
  SharedTreeFormatVersion,
16
+ buildConfiguredForest,
17
+ defaultSharedTreeOptions,
18
+ type ForestOptions,
16
19
  } from "./sharedTree.js";
17
20
 
18
21
  export {
@@ -29,6 +32,8 @@ export {
29
32
 
30
33
  export { type TreeStoredContent } from "./schematizeTree.js";
31
34
 
35
+ export { SchematizingSimpleTreeView } from "./schematizingTreeView.js";
36
+
32
37
  export { CheckoutFlexTreeView } from "./checkoutFlexTreeView.js";
33
38
 
34
39
  export type { ISharedTreeEditor, ISchemaEditor } from "./sharedTreeEditBuilder.js";
@@ -41,6 +41,7 @@ import {
41
41
  type TreeViewConfiguration,
42
42
  mapTreeFromNodeData,
43
43
  prepareContentForHydration,
44
+ comparePersistedSchemaInternal,
44
45
  toStoredSchema,
45
46
  } from "../simple-tree/index.js";
46
47
  import { Breakable, breakingClass, disposeSymbol, type WithBreakable } from "../util/index.js";
@@ -225,22 +226,12 @@ export class SchematizingSimpleTreeView<in out TRootSchema extends ImplicitField
225
226
  private update(): void {
226
227
  this.disposeView();
227
228
 
228
- const result = this.viewSchema.checkCompatibility(this.checkout.storedSchema);
229
-
230
- // TODO: AB#8121: Weaken this check to support viewing under additional circumstances.
231
- // In the near term, this should support viewing documents with additional optional fields in their schema on object types.
232
- // Longer-term (as demand arises), we could also add APIs to constructing view schema to allow for more flexibility
233
- // (e.g. out-of-schema content handlers could allow support for viewing docs which have extra allowed types in a particular field)
234
- const canView =
235
- result.write === Compatibility.Compatible && result.read === Compatibility.Compatible;
236
- const canUpgrade = result.read === Compatibility.Compatible;
237
- const isEquivalent = canView && canUpgrade;
238
- const compatibility: SchemaCompatibilityStatus = {
239
- canView,
240
- canUpgrade,
241
- isEquivalent,
242
- canInitialize: canInitialize(this.checkout),
243
- };
229
+ const compatibility = comparePersistedSchemaInternal(
230
+ this.checkout.storedSchema,
231
+ this.viewSchema,
232
+ canInitialize(this.checkout),
233
+ );
234
+
244
235
  let lastRoot =
245
236
  this.compatibility.canView && this.view !== undefined ? this.root : undefined;
246
237
  this.currentCompatibility = compatibility;